Transactional Messages

Transactional Messages AI Tools

Open in ChatGPT

Open in ChatGPT to ask questions about this page

Open in Claude

Open in Claude to ask questions about this page

Copy as Markdown

Copy this page as markdown to use with AI assistants

View as Markdown

Open this page as markdown in a new tab

Send transactional template messages to Arattai users. Transactional messages are event-driven outbound messages for order updates, payment confirmations, service alerts, appointment reminders, and similar notifications.

⚠
NoteTransactional messages support optional API-uploaded attachments. If an attachment is provided via API, it is used; otherwise, the system falls back to any media configured in the template itself (if any).

Retries: ack_key is echoed back for correlation, but this API does not document deduplication behavior for repeated ack_key values. Before retrying after a timeout or a 500 operation_failed response, confirm via a webhook event or status check whether the original request already sent the message, to avoid an unintended duplicate send.

Download Transactional Messages OpenAPI Document
End Points
Send Transactional Messages API
Send Test Transactional Message API

Send Transactional Messages API AI Tools

Open in ChatGPT

Open in ChatGPT to ask questions about this page

Open in Claude

Open in Claude to ask questions about this page

Copy as Markdown

Copy this page as markdown to use with AI assistants

View as Markdown

Open this page as markdown in a new tab

Send a transactional template message to an Arattai user, with or without a file attachment.

⚠
Note
  • Transactional messages support optional API-uploaded attachments. If an attachment is provided via API, it is used; otherwise, the system falls back to any media configured in the template itself (if any).
  • To send with an attachment, use multipart/form-data encoding. The request body is then reserved for the files field, so id, language, variables, and authentication_code must be passed as query parameters instead. For a standard request without an attachment, use application/json and include all of these fields in the body as usual.
  • Supported Media Types (files):
    • Images: jpeg / jpg / png / gif / avif / webp - max 5 MB
    • Audio: mp3 / aac / amr - max 20 MB
    • Video: mp4 / webm / mkv - max 20 MB
    • Document: pdf - max 20 MB
    • Plain text - max 20 MB
  • Files are antivirus-scanned; the filename must be alphanumeric and a maximum of 250 characters.


Rate Limits
  • Per recipient: 15 messages per minute.
  • All recipients (platform-wide): 80 messages per second, up to 100,000 messages per day.
  • Unique recipients reachable per day: 1,000. This can be increased - contact us and we will verify and raise the limit.
  • Lock Period (wait time after the threshold is hit before consecutive requests are accepted): 1 minute.

OAuth Scope : ArattaiBusiness.messages.CREATE

Arguments

id
string
(Required)
Required string. Unique identifier of the message template.
Follow the steps to retrieve the template ID.
phone_number
string
Required string if `user_id` is not provided. The customer's mobile number to which the message will be sent.
  • Format: country_code-phone_number (hyphen required)
  • Country code can optionally include a leading +
  • Examples: 91-9876543210 or +91-9876543210
  • Regex: ^\+?[1-9]\d{0,2}-\d{7,14}$
user_id
string
Optional string. The Arattai user ID of the recipient. Required if `phone_number` is not provided.
  • Can be used instead of or in addition to phone_number.
language
string
Optional string. ISO language code value.
  • Specifies the language in which the template should be sent.
  • The created template must have a corresponding language version set up in Arattai Business Platform.
  • Allowed values: en | es | fr | de | it | pt | ru | zh | ja | ko | ar | hi | ta | te | ml | bn | gu | mr | pa | th | tr | nl | pl | sv | no | da | fi | cs | el | ro | hu | vi | id | ms | he | ur | fa | sw | uk | bg | sr | sk | sl | ca | eu | gl | et | lv | lt | is | zh_tw | kn | or
  • Note: Chinese Simplified is zh, Chinese Traditional is zh_tw (lowercase, underscore)
variables
object
Optional JSON Object. Only required if the template contains placeholders.
Key-value mapping of placeholder names defined in the template and the dynamic values to replace them with.
authentication_code
string
Optional string. Only needed if the template contains a "Copy Code" or "One-tap authentication" button - not specific to the Authentication Messages API; any template type can define this kind of button.
  • Maximum length: 50 characters.
  • Allowed characters: alphanumeric and hyphens only (regex: ^[A-Za-z0-9\-]+$)
  • The value supplied here is the exact code displayed in (or copyable from) that button. Example: a shipping-update template with a "Copy Code" button for a delivery verification code would set authentication_code to 482913.
buttons
array
Required array if the template has a miniapp button. Not needed for templates with only quick_reply, url, or copy_code buttons.
  • Must contain one entry per button defined on the template, in the same order.
  • For a miniapp button, provide the mini app deep-link path to open when the button is tapped.
Show Sub-Attributes arrow
type
string
Button type as defined on the template (e.g. miniapp).
value
string
Required for type miniapp. The mini app deep-link path to open.
ack_key
string
Optional string. Your own correlation key for this message. Echoed back in the send response and in every webhook event for the message. Auto-generated if omitted. Alphanumeric, underscore, and hyphen only. Maximum 64 characters.
files
binary
Optional file. multipart/form-data only - not used in JSON requests. Media attachment for the message.
  • Images: jpeg / jpg / png / gif / avif / webp - max 5 MB
  • Audio: mp3 / aac / amr - max 20 MB
  • Video: mp4 / webm / mkv - max 20 MB
  • Document: pdf - max 20 MB
  • Plain text - max 20 MB
Antivirus-scanned; filename must be alphanumeric, maximum 250 characters.

Query Parameters

id
string
Template ID (string). Required when sending with attachments via multipart/form-data.
When using JSON body, include this in the body instead.
Follow the steps to retrieve the template ID.
language
string
Optional string. ISO language code value. Use this when sending with attachments.
  • Specifies the language in which the template should be sent.
  • The created template must have a corresponding language version set up in Arattai Business Platform.
  • Allowed values: en | es | fr | de | it | pt | ru | zh | ja | ko | ar | hi | ta | te | ml | bn | gu | mr | pa | th | tr | nl | pl | sv | no | da | fi | cs | el | ro | hu | vi | id | ms | he | ur | fa | sw | uk | bg | sr | sk | sl | ca | eu | gl | et | lv | lt | is | zh_tw | kn | or
  • Note: Chinese Simplified is zh, Chinese Traditional is zh_tw (lowercase, underscore)
variables
string
Optional JSON Object (URL-encoded string when used as query parameter).
Key-value mapping of template placeholder names and their dynamic values.
Use this when sending with attachments; otherwise include in JSON body.
authentication_code
string
Optional string. Only needed if the template contains a "Copy Code" or "One-tap authentication" button - not specific to the Authentication Messages API; any template type can define this kind of button. Use this query parameter when sending with attachments (multipart/form-data); for JSON body requests, include this field in the body instead.
  • Maximum length: 50 characters.
  • Allowed characters: alphanumeric and hyphens only (regex: ^[A-Za-z0-9\-]+$)
  • The value supplied here is the exact code displayed in (or copyable from) that button. Example: a shipping-update template with a "Copy Code" button for a delivery verification code would set authentication_code to 482913.

Headers

Arattai-CompanyId
string
(Required)
The unique identifier of the company for this request.
Arattai-BusinessNumberId
string
(Required)
The unique identifier of the business number from which the message will be sent.
  • This header is required for all requests.
  • Obtain this ID from your Arattai Business Platform dashboard.

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("Arattai-CompanyId", "SOME_STRING_VALUE"); headers_data.put("Arattai-BusinessNumberId", "SOME_STRING_VALUE"); headers_data.put("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://business.arattai.in/api/v1/transactions" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://business.arattai.in/api/v1/transactions") .post(body) .addHeader("Arattai-CompanyId", "SOME_STRING_VALUE") .addHeader("Arattai-BusinessNumberId", "SOME_STRING_VALUE") .addHeader("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'Arattai-CompanyId': 'SOME_STRING_VALUE', 'Arattai-BusinessNumberId': 'SOME_STRING_VALUE', Authorization: 'Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://business.arattai.in/api/v1/transactions', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("business.arattai.in") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Arattai-CompanyId': "SOME_STRING_VALUE", 'Arattai-BusinessNumberId': "SOME_STRING_VALUE", 'Authorization': "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/api/v1/transactions", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "POST", "hostname": "business.arattai.in", "port": null, "path": "/api/v1/transactions", "headers": { "Arattai-CompanyId": "SOME_STRING_VALUE", "Arattai-BusinessNumberId": "SOME_STRING_VALUE", "Authorization": "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end();
var client = new RestClient("https://business.arattai.in/api/v1/transactions"); var request = new RestRequest(Method.POST); request.AddHeader("Arattai-CompanyId", "SOME_STRING_VALUE"); request.AddHeader("Arattai-BusinessNumberId", "SOME_STRING_VALUE"); request.AddHeader("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); request.AddHeader("content-type", "application/json"); request.AddParameter("application/json", "{\"field1\":\"value1\",\"field2\":\"value2\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Post, RequestUri = new Uri("https://business.arattai.in/api/v1/transactions"), Headers = { { "Arattai-CompanyId", "SOME_STRING_VALUE" }, { "Arattai-BusinessNumberId", "SOME_STRING_VALUE" }, { "Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }, }, Content = new StringContent("{\"field1\":\"value1\",\"field2\":\"value2\"}") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } } }; using (var response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body); }
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://business.arattai.in/api/v1/transactions" payload := strings.NewReader("{\"field1\":\"value1\",\"field2\":\"value2\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Arattai-CompanyId", "SOME_STRING_VALUE") req.Header.Add("Arattai-BusinessNumberId", "SOME_STRING_VALUE") req.Header.Add("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
const data = JSON.stringify({ "field1": "value1", "field2": "value2" }); const xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("POST", "https://business.arattai.in/api/v1/transactions"); xhr.setRequestHeader("Arattai-CompanyId", "SOME_STRING_VALUE"); xhr.setRequestHeader("Arattai-BusinessNumberId", "SOME_STRING_VALUE"); xhr.setRequestHeader("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); xhr.setRequestHeader("content-type", "application/json"); xhr.send(data);
curl --request POST \ --url https://business.arattai.in/api/v1/transactions \ --header 'Arattai-BusinessNumberId: SOME_STRING_VALUE' \ --header 'Arattai-CompanyId: SOME_STRING_VALUE' \ --header 'Authorization: Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "id": "72387427812", "phone_number": "91-9876543210", "language": "en", "variables": { "customer_name": "Ryan West", "order_id": "ORD-982341", "total_amount": "$249.00" } }
{ "id": "72387427812", "phone_number": "91-9876543210", "language": "en", "variables": { "customer_name": "Ryan West", "order_id": "ORD-982341" }, "buttons": [ { "type": "miniapp", "value": "/orders/ORD-982341" } ] }
{ "phone_number": "91-9876543210", "files": "@invoice.pdf" }

Response Example

{ "url": "/api/v1/transactions", "type": "message", "data": { "user_id": "1001000000001001", "cost": "0.5000", "ack_key": "4460871754199042" } }
{ "code": "invalid_recipient", "message": "The recipient is not an Arattai user" }
{ "code": "invalid_input", "message": "Either the input stream or parameter is invalid or absent" }
{ "code": "unsupported_file", "message": "File is not supported" }
{ "code": "invalid_file_type", "message": "The uploaded file type is not supported" }
{ "code": "invalid_file_name", "message": "File name is invalid" }
{ "code": "antivirus_threat", "message": "The uploaded file was flagged by the antivirus scan" }
{ "code": "url_not_accessible", "message": "The media URL provided is not accessible" }
{ "code": "no_ongoing_conversation", "message": "No ongoing conversation exists with this user_id. Send by phone_number instead" }
{ "code": "business_recipient_not_allowed", "message": "This business number is not allowed to message the recipient" }
{ "code": "unassociated_template", "message": "The template ID is not associated with this business" }
{ "code": "empty_file_not_allowed", "message": "The uploaded file is empty" }
{ "code": "missing_header", "message": "Arattai-BusinessNumberId header is required" }
{ "code": "too_many_requests", "message": "You have reached the maximum number of requests" }
{ "code": "invalid_oauthtoken", "message": "You are not authenticated to do this operation" }
{ "code": "payment_required", "message": "Insufficient credits to perform this action" }
{ "code": "unauthorised", "message": "The user does not have enough permission to access the resource." }
{ "code": "invalid_method", "message": "Invalid method" }
{ "code": "recipient_identity_mismatch", "message": "The provided user_id does not match the current Arattai user for this phone number. The number may now belong to a different user" }
{ "code": "file_size_too_large", "message": "Size of the file is too large" }
{ "code": "too_many_requests", "message": "You have reached the maximum number of requests" }
{ "code": "operation_failed", "message": "An unexpected error occurred while processing the request" }

Send Test Transactional Message API AI Tools

Open in ChatGPT

Open in ChatGPT to ask questions about this page

Open in Claude

Open in Claude to ask questions about this page

Copy as Markdown

Copy this page as markdown to use with AI assistants

View as Markdown

Open this page as markdown in a new tab

Send a transactional template message to a test customer. Credits are not billed and the send does not count against production quotas. File attachments are supported with the same formats and size limits as the production endpoint.

⚠
Note
  • The recipient must be an active test customer for this business number. If not, 400 invalid_recipient is returned.
  • A limit of 500 test messages per business number per day applies.
  • To send with an attachment, use multipart/form-data encoding. The request body is then reserved for the files field, so id, language, mode, and variables must be passed as query parameters instead. For a standard request without an attachment, use application/json and include all of these fields in the body as usual.
  • Supported Media Types (files):
    • Images: jpeg / jpg / png / gif / avif / webp - max 5 MB
    • Audio: mp3 / aac / amr - max 20 MB
    • Video: mp4 / webm / mkv - max 20 MB
    • Document: pdf - max 20 MB
    • Plain text - max 20 MB
  • Files are antivirus-scanned; the filename must be alphanumeric and a maximum of 250 characters.

mode (required): Specifies which translation version to send:
  • draft: Sends from the current draft translation.
  • published: Sends from the last approved/published translation.

Rate Limits
  • Threshold Limit (Number of API calls allowed within a minute) - 30 requests per minute
  • Lock Period (Wait time before consecutive API requests) - 1 minute


OAuth Scope : ArattaiBusiness.messages.CREATE

Arguments

phone_number
string
(Required)
Required string. The test customer's mobile number.
  • Format: country_code-phone_number (hyphen required)
  • Examples: 91-9876543210 or +91-9876543210
id
string
(Required)
Required string. Unique identifier of the message template.
language
string
Optional string. ISO language code value.
mode
string
(Required)
Required string. Which translation version to send.
Allowed values: draft, published.
variables
object
Optional object. Key-value mapping of template placeholder names and their dynamic values.
user_id
string
Optional string. The Arattai user ID of the recipient.
buttons
array
Required array if the template has a miniapp button. Not needed for templates with only quick_reply, url, or copy_code buttons.
  • Must contain one entry per button defined on the template, in the same order.
  • For a miniapp button, provide the mini app deep-link path to open when the button is tapped.
Show Sub-Attributes arrow
type
string
Button type as defined on the template (e.g. miniapp).
value
string
Required for type miniapp. The mini app deep-link path to open.
ack_key
string
Optional string. Your own correlation key for this message. Echoed back in the send response and in every webhook event for the message. Auto-generated if omitted. Alphanumeric, underscore, and hyphen only. Maximum 64 characters.
files
binary
Optional file. multipart/form-data only - not used in JSON requests. Media attachment for the message.
  • Images: jpeg / jpg / png / gif / avif / webp - max 5 MB
  • Audio: mp3 / aac / amr - max 20 MB
  • Video: mp4 / webm / mkv - max 20 MB
  • Document: pdf - max 20 MB
  • Plain text - max 20 MB
Antivirus-scanned; filename must be alphanumeric, maximum 250 characters.

Query Parameters

id
string
Template ID. Required when sending with attachments via multipart/form-data.
language
string
Optional. ISO language code. Use this when sending with attachments.
mode
string
Required when sending with attachments. "draft" or "published".
variables
string
Optional. JSON Object (URL-encoded). Use when sending with attachments.

Headers

Arattai-CompanyId
string
(Required)
The unique identifier of the company for this request.
Arattai-BusinessNumberId
string
(Required)
The unique identifier of the business number from which the test message will be sent.

Request Example

Click to copy
parameters_data='{"field1":"value1","field2":"value2"}'; headers_data = Map(); headers_data.put("Arattai-CompanyId", "SOME_STRING_VALUE"); headers_data.put("Arattai-BusinessNumberId", "SOME_STRING_VALUE"); headers_data.put("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); response = invokeUrl [ url: "https://business.arattai.in/api/v1/transactions/test" type: POST headers: headers_data content-type: application/json parameters: parameters_data connection: <connection_name> ]; info response;
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}"); Request request = new Request.Builder() .url("https://business.arattai.in/api/v1/transactions/test") .post(body) .addHeader("Arattai-CompanyId", "SOME_STRING_VALUE") .addHeader("Arattai-BusinessNumberId", "SOME_STRING_VALUE") .addHeader("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") .addHeader("content-type", "application/json") .build(); Response response = client.newCall(request).execute();
const options = { method: 'POST', headers: { 'Arattai-CompanyId': 'SOME_STRING_VALUE', 'Arattai-BusinessNumberId': 'SOME_STRING_VALUE', Authorization: 'Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f', 'content-type': 'application/json' }, body: '{"field1":"value1","field2":"value2"}' }; fetch('https://business.arattai.in/api/v1/transactions/test', options) .then(response => response.json()) .then(response => console.log(response)) .catch(err => console.error(err));
import http.client conn = http.client.HTTPSConnection("business.arattai.in") payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}" headers = { 'Arattai-CompanyId': "SOME_STRING_VALUE", 'Arattai-BusinessNumberId': "SOME_STRING_VALUE", 'Authorization': "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", 'content-type': "application/json" } conn.request("POST", "/api/v1/transactions/test", payload, headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8"))
const http = require("https"); const options = { "method": "POST", "hostname": "business.arattai.in", "port": null, "path": "/api/v1/transactions/test", "headers": { "Arattai-CompanyId": "SOME_STRING_VALUE", "Arattai-BusinessNumberId": "SOME_STRING_VALUE", "Authorization": "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f", "content-type": "application/json" } }; const req = http.request(options, function (res) { const chunks = []; res.on("data", function (chunk) { chunks.push(chunk); }); res.on("end", function () { const body = Buffer.concat(chunks); console.log(body.toString()); }); }); req.write(JSON.stringify({field1: 'value1', field2: 'value2'})); req.end();
var client = new RestClient("https://business.arattai.in/api/v1/transactions/test"); var request = new RestRequest(Method.POST); request.AddHeader("Arattai-CompanyId", "SOME_STRING_VALUE"); request.AddHeader("Arattai-BusinessNumberId", "SOME_STRING_VALUE"); request.AddHeader("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); request.AddHeader("content-type", "application/json"); request.AddParameter("application/json", "{\"field1\":\"value1\",\"field2\":\"value2\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
var client = new HttpClient(); var request = new HttpRequestMessage { Method = HttpMethod.Post, RequestUri = new Uri("https://business.arattai.in/api/v1/transactions/test"), Headers = { { "Arattai-CompanyId", "SOME_STRING_VALUE" }, { "Arattai-BusinessNumberId", "SOME_STRING_VALUE" }, { "Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }, }, Content = new StringContent("{\"field1\":\"value1\",\"field2\":\"value2\"}") { Headers = { ContentType = new MediaTypeHeaderValue("application/json") } } }; using (var response = await client.SendAsync(request)) { response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body); }
package main import ( "fmt" "strings" "net/http" "io/ioutil" ) func main() { url := "https://business.arattai.in/api/v1/transactions/test" payload := strings.NewReader("{\"field1\":\"value1\",\"field2\":\"value2\"}") req, _ := http.NewRequest("POST", url, payload) req.Header.Add("Arattai-CompanyId", "SOME_STRING_VALUE") req.Header.Add("Arattai-BusinessNumberId", "SOME_STRING_VALUE") req.Header.Add("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f") req.Header.Add("content-type", "application/json") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) }
const data = JSON.stringify({ "field1": "value1", "field2": "value2" }); const xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.addEventListener("readystatechange", function () { if (this.readyState === this.DONE) { console.log(this.responseText); } }); xhr.open("POST", "https://business.arattai.in/api/v1/transactions/test"); xhr.setRequestHeader("Arattai-CompanyId", "SOME_STRING_VALUE"); xhr.setRequestHeader("Arattai-BusinessNumberId", "SOME_STRING_VALUE"); xhr.setRequestHeader("Authorization", "Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"); xhr.setRequestHeader("content-type", "application/json"); xhr.send(data);
curl --request POST \ --url https://business.arattai.in/api/v1/transactions/test \ --header 'Arattai-BusinessNumberId: SOME_STRING_VALUE' \ --header 'Arattai-CompanyId: SOME_STRING_VALUE' \ --header 'Authorization: Bearer 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \ --header 'content-type: application/json' \ --data '{"field1":"value1","field2":"value2"}'

Body Parameters

Click to copy
{ "phone_number": "91-9876543210", "id": "9QT221ZRP3", "language": "en", "mode": "draft", "variables": { "order_id": "ORD-20240115-001" } }
{ "phone_number": "91-9876543210", "id": "9QT221ZRP3", "language": "en", "mode": "draft", "variables": { "order_id": "ORD-20240115-001" }, "buttons": [ { "type": "miniapp", "value": "/orders/ORD-20240115-001" } ] }
{ "phone_number": "91-9876543210", "files": "@invoice.pdf" }

Response Example

{ "url": "/api/v1/transactions/test", "type": "message", "data": { "user_id": "1001000000001001", "ack_key": "4460871754199043" } }
{ "code": "invalid_recipient", "message": "The recipient is not an Arattai user" }
{ "code": "invalid_input", "message": "Either the input stream or parameter is invalid or absent" }
{ "code": "unsupported_file", "message": "File is not supported" }
{ "code": "invalid_file_type", "message": "The uploaded file type is not supported" }
{ "code": "invalid_file_name", "message": "File name is invalid" }
{ "code": "antivirus_threat", "message": "The uploaded file was flagged by the antivirus scan" }
{ "code": "url_not_accessible", "message": "The media URL provided is not accessible" }
{ "code": "empty_file_not_allowed", "message": "The uploaded file is empty" }
{ "code": "missing_header", "message": "Arattai-BusinessNumberId header is required" }
{ "code": "too_many_requests", "message": "You have reached the maximum number of requests" }
{ "code": "invalid_oauthtoken", "message": "You are not authenticated to do this operation" }
{ "code": "invalid_method", "message": "Invalid method" }
{ "code": "file_size_too_large", "message": "Uploaded file exceeds the maximum allowed size" }
{ "code": "test_customer_message_limit_exceeded", "message": "This test customer has reached its daily message limit. Please try again later" }
{ "code": "operation_failed", "message": "An unexpected error occurred while processing the request" }