Webhooks are a way to interact with getOperate using standard web technologies.
/p/u/<your_user>/<your_script_name>
, which will always trigger the latest
version of the Script/Flow and the other one with just a hash, i.e. /h/<hash>
,
hiding potentially sensitive information and always corresponding to that
version of the script, even with overwrites.
u/
or f/
These links are available in the “Result/Sync” tab.
Sync get endpoints support adding args directly, use include_query=a,b,c&a=foo&b=bar&c=foobar
to have a: “foo”, b: “bar”, c: “foobar”, passed as args.
GET
request.
The payload must be passed as the query arg payload
and encoded in JSON first, then in an URL safe base64,
e.g: encodeURIComponent(btoa(JSON.stringify({a: 2})))
.
This endpoint has the same URL as the Result/Sync POST Path URLs.200
status code with the error as a JSON object.
When using the asynchronous mode, the webhook returns a uuid
and you can poll the get job API call to fetch the status and results once it is completed.
Bearer
token authentication.
You can generate tokens for your own account in the
Account Settings menu in the app. Open it by
clicking your username on the side menu, then select “Account settings”.
Labels are only used to allow users to easily distinguish keys.
Authorization: Bearer <TOKEN>
header, or as a token
query parameter:
https://<instance>/<route>?token=<TOKEN>
POST
requests:
include_header
, separated with ,
. e.g: /api/w/admins/jobs/run_wait_result/p/u/user/undisputed_script?include_header=X-Sign,foo
or use the env variable: INCLUDE_HEADERS
with the same format so that all requests to any job will include the headers.
body
and the value will be the payload/body itself. e.g:
raw=true
, then an additional argument will be added: raw_string
which contains the entire json payload as a string (without any parsing). This is useful to verify the signature of the payload for example (discord require the endpoints to verify the signature for instance).
getOperate_status_code
with a number value, that value will be used as the status code. For example, if a script or flow returns:
201
.
Note that if the status code is invalid (w.r.t RFC9110), the endpoint will return an error.
getOperate_content_type
, the associated value will be used as the content type header of the response. For example, if a script or flow returns:
handle_path
and rewrite
directive can be used: