POST
/api/v1/hookCreate Hook
Hooks or Webhooks are user-defined HTTP callbacks or endpoints that allow applications to send real-time notifications or data to a specified URL when a particular event or trigger occurs. By making a POST request to this endpoint, users can provide the necessary parameters and details in the request body to define a new hook. This includes information such as the endpoint, authtype, userId and any other relevant parameters or configurations.
POST
/api/v1/hookMandatory Fields
- endPoint
- hookType
- isActiveStatus
- _shop
Parameter Details
| Name | In | Type | Required | Description |
|---|---|---|---|---|
body | body | Required | none |
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | Success | |
| 400 | Bad Request | Request data failed validation(s) | None |
| 401 | Unauthorized | Authentication Failed! | None |
| 429 | Too Many Requests | Too Many Requests. | None |
| 500 | Internal Server Error | Internal Server Error | None |
Example Request
# You can also use wget
curl -X POST /api/v1/hook \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: API_KEY'
Body parameter
{
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "uuxx",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8"
}
Example responses
200 Response
{
"error": false,
"hook": {
"_user": "63fda531bde67155fc46fb41",
"userName": "user@flightrates.com",
"endPoint": "//my-hook",
"authType": "jwt",
"userId": "63fda531bde67155fc46fb4",
"pwdTxt": "demo1",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6I",
"hookType": "dbs",
"isActiveStatus": true,
"_shop": "63fdc414cccc3592d31b3ac8",
"vertical": "flightrates",
"isCustomerCreated": true,
"id": "63ff246fb2482db1c660e310"
}
}
Need Support?
Our team is here to help you integrate and make the most of our APIs. Get in touch for technical support, custom solutions, or any questions.