New Response Templates API for Re:amaze Developers

Last Updated on May 1, 2020 by David

There is a brand new API end point for Re:amaze Response Templates! To access this API, head over to https://www.reamaze.com/api and click on the “Response Templates” section.

Here’s what’s new:

GET /response_templates

Issuing a GET call to response_templates will allow you to retrieve Response Templates for the Brand. This will also return personal Response Templates depending on the user role.

Example Request

curl 'https://{brand}.reamaze.io/api/v1/response_templates' \
  -u {login-email}:{api-token} \
  -H 'Accept: application/json'

Example Response

{
  "response_templates": [
    {
      "id": 123,
      "name": "Returns Instructions",
      "body": "...",
      "response_template_group": {
        "id": 123,
        "name": "Returns"
      }
    }
    ...
  ]
}

GET /response_templates/{id}

Issuing a GET call to response_templates will allow you to retrieve a specific Response Template

Example Request

curl 'https://{brand}.reamaze.io/api/v1/response_templates/{id}' \
  -u {login-email}:{api-token} \
  -H 'Accept: application/json'

Example Response

{
  "id": 123,
  "name": "Returns Instructions",
  "body": "...",
  "response_template_group": {
    "id": 123,
    "name": "Returns"
  }
}

POST /response_templates

Issuing a POST call to response_templates will allow you to create a new Response Template

Example Request

curl 'https://{brand}.reamaze.io/api/v1/topics/{slug}/response_templates' \
  -u {login-email}:{api-token} \
  -H 'Accept: application/json' \
  -H 'Content-type: application/json' \
  -X POST -d '{"response_template": {"name": "foo", "body": "support", "is_personal": 0}}'

Response

A successful request will return the JSON for the newly created response template.

A failed request will return an HTTP 422 Unprocessable Entity with the JSON body explaining the error.

PUT /response_templates/{slug}

Issuing a PUT call to a specific response template will allow you to update the response template.

Issuing a PUT call to a specific response template will allow you to update the response template.

Example Request

curl 'https://{brand}.reamaze.io/api/v1/response_templates/{id}' \
  -u {login-email}:{api-token} \
  -H 'Accept: application/json' \
  -H 'Content-type: application/json' \
  -X PUT -d '{"response_template": {"name": "new name", "body": "new body", "is_personal": 0}}'

Response

A successful request will return the JSON for the updated response template.

A failed request will return an HTTP 422 Unprocessable Entity with the JSON body explaining the error.