Webhook

WIP: A summary needs to be written for Webhook


GET/v3/webhook/:id

Find

Find one by id

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the object to retrieve

Produces

The response content type: application/json

200 Response

  • Name
    data
    Type
    object Required
    Description
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Properties for data object

  • Name
    id
    Type
    string Required
    Description
  • Name
    meta
    Type
    object Required
    Description
    the metadata about the most recent change to the row
  • Name
    createdDate
    Type
    string Required
    Description
  • Name
    updatedDate
    Type
    string Required
    Description
  • Name
    companyId
    Type
    string Required
    Description
  • Name
    locationId
    Type
    string Required
    Description
    optional location id, if not set, the webhook is global for the company
  • Name
    name
    Type
    string Required
    Description
    the name of the webhook which must be unique between webhooks
  • Name
    url
    Type
    string Required
    Description
    the url to send the webhook
  • Name
    triggers
    Type
    array Required
    Description
  • Name
    enabled
    Type
    boolean Required
    Description
    if true, the webhook is enabled
  • Name
    error
    Type
    boolean Required
    Description
    if true, the webhook is in an errored state
  • Name
    errorMessage
    Type
    string Required
    Description
    if error=true, the detailed message about the error
  • Name
    errorDate
    Type
    string Required
    Description
    if error=true, when the error was set
  • Name
    createdById
    Type
    string Required
    Description
  • Name
    version
    Type
    string Required
    Description
    the webhook api version
  • Name
    secret
    Type
    string
    Description

Properties for meta object

  • Name
    userId
    Type
    string
    Description
    the user id that made the most recent change
  • Name
    sessionId
    Type
    string
    Description
    the session id for the most recent change
  • Name
    version
    Type
    number
    Description
    a monotonically increasing number for the most recent change

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    object
    Description
    An optional object containing relevant error data
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    object
    Description
    An optional object containing relevant error data
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request

GET
/v3/webhook/:id
curl https://api.shopmonkey.cloud/v3/webhook/:id \
  -H "Authorization: Bearer ${SM_TOKEN}"

Example Response
application/json

{
  "success": true,
  "data": {
    "id": "id",
    "meta": {
      "userId": "userId",
      "sessionId": "sessionId",
      "version": 1
    },
    "createdDate": "createdDate",
    "updatedDate": null,
    "companyId": "companyId",
    "locationId": "locationId",
    "name": "name",
    "url": "url",
    "triggers": [
      "triggers"
    ],
    "enabled": true,
    "error": true,
    "errorMessage": null,
    "errorDate": null
  }
}

PUT/v3/webhook/:id

Update

Update one by id

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the object to update

Body parameters

Consumes

The following content type is required: application/json

  • Name
    name
    Type
    string
    Description
    the name of the webhook which must be unique between webhooks
  • Name
    url
    Type
    string
    Description
    the url to send the webhook
  • Name
    triggers
    Type
    array
    Description
  • Name
    enabled
    Type
    boolean
    Description
    if true, the webhook is enabled
  • Name
    error
    Type
    boolean
    Description
    if true, the webhook is in an errored state
  • Name
    errorMessage
    Type
    string
    Description
    if error=true, the detailed message about the error
  • Name
    errorDate
    Type
    string
    Description
    if error=true, when the error was set
  • Name
    version
    Type
    string
    Description
    the webhook api version
  • Name
    secret
    Type
    string
    Description

Produces

The response content type: application/json

200 Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if success = false
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message
  • Name
    data
    Type
    object Required
    Description

Properties for data object

  • Name
    id
    Type
    string Required
    Description
  • Name
    createdDate
    Type
    string Required
    Description
  • Name
    updatedDate
    Type
    string Required
    Description
  • Name
    companyId
    Type
    string Required
    Description
  • Name
    locationId
    Type
    string Required
    Description
    optional location id, if not set, the webhook is global for the company
  • Name
    name
    Type
    string Required
    Description
    the name of the webhook which must be unique between webhooks
  • Name
    url
    Type
    string Required
    Description
    the url to send the webhook
  • Name
    triggers
    Type
    array Required
    Description
  • Name
    enabled
    Type
    boolean Required
    Description
    if true, the webhook is enabled
  • Name
    error
    Type
    boolean Required
    Description
    if true, the webhook is in an errored state
  • Name
    errorMessage
    Type
    string Required
    Description
    if error=true, the detailed message about the error
  • Name
    errorDate
    Type
    string Required
    Description
    if error=true, when the error was set
  • Name
    createdById
    Type
    string Required
    Description
  • Name
    version
    Type
    string Required
    Description
    the webhook api version
  • Name
    secret
    Type
    string
    Description

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    object
    Description
    An optional object containing relevant error data
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    object
    Description
    An optional object containing relevant error data
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request
application/json

PUT
/v3/webhook/:id
curl https://api.shopmonkey.cloud/v3/webhook/:id \
  -H "Authorization: Bearer ${SM_TOKEN}" \
  -X PUT -H 'Content-Type: application/json' \
  --data '{}'

Example Response
application/json

{
  "success": true
}

POST/v3/webhook

Create

Create one

Body parameters

Consumes

The following content type is required: application/json

  • Name
    name
    Type
    string Required
    Description
    the name of the webhook which must be unique between webhooks
  • Name
    url
    Type
    string Required
    Description
    the url to send the webhook
  • Name
    triggers
    Type
    array
    Description
  • Name
    enabled
    Type
    boolean
    Description
    if true, the webhook is enabled
  • Name
    error
    Type
    boolean
    Description
    if true, the webhook is in an errored state
  • Name
    errorMessage
    Type
    string
    Description
    if error=true, the detailed message about the error
  • Name
    errorDate
    Type
    string
    Description
    if error=true, when the error was set
  • Name
    version
    Type
    string
    Description
    the webhook api version
  • Name
    secret
    Type
    string
    Description

Produces

The response content type: application/json

200 Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if success = false
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message
  • Name
    data
    Type
    object Required
    Description

Properties for data object

  • Name
    id
    Type
    string Required
    Description
  • Name
    createdDate
    Type
    string Required
    Description
  • Name
    updatedDate
    Type
    string Required
    Description
  • Name
    companyId
    Type
    string Required
    Description
  • Name
    locationId
    Type
    string Required
    Description
    optional location id, if not set, the webhook is global for the company
  • Name
    name
    Type
    string Required
    Description
    the name of the webhook which must be unique between webhooks
  • Name
    url
    Type
    string Required
    Description
    the url to send the webhook
  • Name
    triggers
    Type
    array Required
    Description
  • Name
    enabled
    Type
    boolean Required
    Description
    if true, the webhook is enabled
  • Name
    error
    Type
    boolean Required
    Description
    if true, the webhook is in an errored state
  • Name
    errorMessage
    Type
    string Required
    Description
    if error=true, the detailed message about the error
  • Name
    errorDate
    Type
    string Required
    Description
    if error=true, when the error was set
  • Name
    createdById
    Type
    string Required
    Description
  • Name
    version
    Type
    string Required
    Description
    the webhook api version
  • Name
    secret
    Type
    string
    Description

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    object
    Description
    An optional object containing relevant error data
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    object
    Description
    An optional object containing relevant error data
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request
application/json

POST
/v3/webhook
curl https://api.shopmonkey.cloud/v3/webhook \
  -H "Authorization: Bearer ${SM_TOKEN}" \
  -H 'Content-Type: application/json' \
  --data '{ "name" : "value", "url" : "value" }'

Example Response
application/json

{
  "success": true,
  "data": {
    "id": "id",
    "createdDate": "createdDate",
    "updatedDate": null,
    "companyId": "companyId",
    "locationId": "locationId",
    "name": "name",
    "url": "url",
    "triggers": [
      "triggers"
    ],
    "enabled": true,
    "error": true,
    "errorMessage": null,
    "errorDate": null
  }
}

DELETE/v3/webhook/:id

Delete Webhook

Delete one Webhook by id

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the id for the object to delete

Produces

The response content type: application/json

200 Response

  • Name
    data
    Type
    object
    Description
  • Name
    success
    Type
    boolean Required
    Description

Properties for data object

  • Name
    id
    Type
    string Required
    Description
    the id for the object

4xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    object
    Description
    An optional object containing relevant error data
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

5xx Response

  • Name
    code
    Type
    string
    Description
    The error code
  • Name
    data
    Type
    object
    Description
    An optional object containing relevant error data
  • Name
    documentation_url
    Type
    string
    Description
    An optional link to the documentation for the error
  • Name
    message
    Type
    string
    Description
    the error message if not successful
  • Name
    success
    Type
    boolean Required
    Description
    if successful, will be true. if not successful, will be false and message will contain a human readable error message

Example Request
application/json

DELETE
/v3/webhook/:id
curl https://api.shopmonkey.cloud/v3/webhook/:id \
  -H "Authorization: Bearer ${SM_TOKEN}" \
  -X DELETE -H 'Content-Type: application/json' \
  --data '{}'

Example Response
application/json

{
  "success": true
}