Difference between revisions of "Store The Text Message Templates"
Ashley DeBon (talk | contribs) (Created page with "== Add Text Message Template == === Base URL === https://apimobile.callproof.com === Endpoint === /api/text-message-templates === Purpose === Creates a new SMS/text message...") |
Ashley DeBon (talk | contribs) (→Successful Response (200)) |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | == Add Text Message Template == | + | == [[Mobile_API]] »Add Text Message Template == |
=== Base URL === | === Base URL === | ||
| Line 39: | Line 39: | ||
| title || string || No || Template title (defaults to <code>Title</code> when omitted) | | title || string || No || Template title (defaults to <code>Title</code> when omitted) | ||
|} | |} | ||
| + | |||
| + | === cURL Example for Android === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/text-message-templates' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "message": "YOUR_TEMPLATE_MESSAGE", "title": "" }' </pre> | ||
| + | |||
| + | === cURL Example for iOS === | ||
| + | |||
| + | <pre> curl --location 'https://apimobile.callproof.com/api/text-message-templates' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "message": "YOUR_TEMPLATE_MESSAGE", "title": "" }' </pre> | ||
=== Successful Response (200) === | === Successful Response (200) === | ||
Latest revision as of 06:46, 21 July 2026
Mobile_API »Add Text Message Template
Base URL
https://apimobile.callproof.com
Endpoint
/api/text-message-templates
Purpose
Creates a new SMS/text message template for the authenticated user. The template title is optional; if omitted, a default title is used.
HTTP Method
POST
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | Bearer access token |
Security
- Yes – Requires Bearer Token authentication.
Parameters
Path Parameters
None.
Query Parameters
None.
Request Body
| Parameter | Type | Required | Description |
|---|---|---|---|
| message | string | Yes | Template message body (commas in the message are stored as spaces) |
| title | string | No | Template title (defaults to Title when omitted)
|
cURL Example for Android
curl --location 'https://apimobile.callproof.com/api/text-message-templates' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "message": "YOUR_TEMPLATE_MESSAGE", "title": "" }'
cURL Example for iOS
curl --location 'https://apimobile.callproof.com/api/text-message-templates' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'Content-Type: application/json' \ --data '{ "message": "YOUR_TEMPLATE_MESSAGE", "title": "" }'
Successful Response (200)
Indicates that the text message template was created successfully.
| Field | Type | Description |
|---|---|---|
| clientStatusCode | integer | Status indicator for the client (for example, 200) |
| user_id | integer | Identifier of the authenticated user |
| company_id | integer | Identifier of the authenticated user’s company |
| message | string | Confirmation message (for example, "The text message templates details added successfully.") |
| uri | string | Requested resource URI |
Error Responses
| Status Code | Meaning |
|---|---|
| 200 | Validation failed – response body uses clientStatusCode 401 with the first validation error message
|
| 400 | Bad Request – the template could not be created |
| 401 | Unauthorized – missing, invalid, or expired Bearer token |
- Validation (HTTP 200, clientStatusCode 401) – Missing
message. - 400 – An error occurred while creating the template (for example, "Error while retrieving the text message template details").
- 401 – Authentication failed or the access token is missing/expired.