POST
A POST
route supports both a request and a response. We'll cover each below and discuss how these relate to Actions.
POST Request
Actions support HTTP POST
JSON requests to their URL with this body payload:
Here, account
is a base58-encoded representation of the public key of the user making the request.
To facilitate HTTP compression, clients should use Accept-Encoding
headers when requesting, and the Action service should use a Content-Encoding
header when responding.
Post Response
Actions services should respond to POST
requests with an HTTP OK
response in a payload formatted like this:
The links.next
parameter in ActionPostResponse
is related to the Action Chaining spec and is currently not supported by all Blinks-enabled wallets. We're working on bringing Blinks support for it as soon as possible.
The client must handle HTTP client errors, server errors, and redirect responses.
The endpoint should respond with an
application/json
Content-Type
header.
The POST
request also accepts ActionError
responses. This can be found in the GET specification and is useful in cases where you want to have custom input validation in the request and return an error when requirements haven't been satisfied.
New POST types supported
type
- If this is of typetransaction
then client will pop-up the user to sign thetransaction
and then after confirmation renderlinks.next
.post
then client will skip the pop-up and render thelinks.next
.
transaction
- The value must be a base64-encoded serialized transaction. The client must base64-decode the transaction anddeserialize it.message
- The value must be a UTF-8 string that describes the nature of the transaction included in the response. The client should display this value to the user. For example, this might be the name of an item being purchased, a discount applied to a purchase, or a thank you note.links.next
- An optional value use to "chain" multiple Actions together in series. After the includedtransaction
has been confirmed on-chain, the client can fetch and render the next action. See Action Chaining for more details.The client and application should allow additional fields in the request body and response body, which may be added by future specification updates.
Last updated