Miyuu's Image Board

help:api_write_requests


These are API requests which use the HTTP POST, PUT/PATCH or DELETE methods.

Limit

These types of requests are rate-limited per user level (Help:Users). Burst writes is just where the available API writes caps off at. Regen rate is just how quickly the available writes get replaced after use.


[table]

[thead]

[tr]

[th]Member levels[/th]

[th]Burst writes[/th]

[th]Regen rate[/th]

[/tr]

[/thead]

[tbody]

[tr]

[td]Member[/td]

[td]10 API writes[/td]

[td]1 write/sec[/td]

[/tr]

[tr]

[td]Gold[/td]

[td]30 API writes[/td]

[td]2 write/sec[/td]

[/tr]

[tr]

[td]Platinum+[/td]

[td]60 API writes[/td]

[td]4 write/sec[/td]

[/tr]

[/tbody]

[/table]

Parameters

The parameters for write requests must be passed along in the body instead of as part of the URL.

URL encoding

These parameters use URL hash encoding (Help:Hash syntax), where the base object is the singular name of the endpoint.

  • Content-Type:
    application/x-www-form-urlencoded
  • Format: OBJECT[PARAMETER]=VALUE
  • Example:
    post[rating]=s&post[tag_string]=danboo

JSON encoding

These parameters use JSON hash encoding "[1]":[#dtext-external-links], where the base object is also the singular name of the endpoint.

  • Content-Type:
    application/json
  • Format: { "OBJECT": { "PARAMETER": VALUE } }
  • Example:
    { "post": { "rating": "s", "tag_string": "danboo" } }

Using POST for method override

The POST method can be used to send data to endpoints that require other methods, in such cases where only one method is available, for instance

HTML elements.

URL encoding

PUT/PATCH and DELETE methods can also be sent by setting the parameter

_method
with the name of the method as its value.

JSON encoding

PUT/PATCH and DELETE methods can also be sent by setting the

X-HTTP-Method-Override
header with the name of the method as its value.

See also

[1] https://www.w3resource.com/JSON/structures.php