GET https://examplebaseURL.com/v1/api/apps/{appID}/data/sms-detail
| Parameter | Type | Description |
|---|---|---|
| id | String | The unique ID generated by CX. |
| fromEID | String | The staff ID of the SMS message sender. |
| toEID | String | The Staff ID of the SMS message recipient. |
| date | String | The date on which the SMS was sent. The format is YYYY/MM/DD |
| cid | String | (Internal use) |
| segmentCount | Number | The number of segments the SMS message splits into. In CINNOX, a single SMS message is limited to 160 chars for English text while 70 chars for non-English text (universal code), e.g., Chinese and Japanese scripts. If the SMS texts exceed the limit, it splits into smaller messages for transmission. If it splits into 2 smaller messages, the value = 2. Refer to the SMS Chat Limit for details. |
| sender | Number | The SMS sender ID. The format is "Country code + phone number", e.g. +85298765432. |
| recipient | Number | The recipient's number used to receive the SMS message. The recipient's SMS number. The format is "Country code + phone number", e.g. +85298765432. |
| recipientCountryCode | String | The country where the recipient received the SMS message. The country code is based on the ISO 3166-1 alpha-2 codes. E.g. country code, "HK" means Hong Kong. |
| status | String | The status of the SMS message. It must be one of the following values: * Submitted (The SMS message has been submitted to the carrier); * Rejected (The SMS message has been rejected by the carrier) |
| carrierStatus | String | The delivery status of the submitted SMS message in the carrier network. It must be one of the following values: * Queued (The carrier network accepted the SMS message); * Delivered (The carrier network delivered the SMS message); * Undelivered (The carrier network did not deliver the SMS message). |
| usage | String | The SMS message source. It must be one of the following values: * direct (The direct engagement to customers via SMS); * verification (The SMS message for verification); * openAPI-sms (The SMS message sent using OpenAPI); * openAPI-otp (The one-time password sent via SMS using OpenAPI) |
| text | String | The SMS message content. |
| createdAt | String | The date and time this record is created. The value must be in RFC3339 format, e.g. 2022-11-07T00:00:00.000Z. |
| updatedAt | String | The date and time this record is updated. The value must be in RFC3339 format, e.g. 2022-11-07T00:00:00.000Z. |
| smsID | String | The ID of the SMS message. |
| isSenderStaff | Boolean | The value = true if the sender is a staff member, while the value = false if the send is not a staff member. |
| isRecipientStaff | Boolean | The value = true if the recipient is a staff member, while the value = false if the recipient is not a staff member. |
appID string required
App ID
startAt string
The date and time the SMS message started to send. The value must be in RFC3339 format, e.g. 2022-11-07T00:00:00.000Z.endAt string
The date and time the CINNOX service finished sending the SMS message. The value must be in RFC3339 format, e.g. 2022-11-07T00:00:00.000Z.offset int32 Defaults to 0
Skip the number of the shown data in the response. If the offset value is 10, the first 10 data will be skipped. The default value is 0.limit int32
The number of data that will be returned, e.g. if the set limit is 10, 10 records returned in the response. The maximum value is 500.source string
Get the SMS message details with the particular source. The source value can be "direct" (The direct engagement to customers via the SMS message), "verification" (The SMS message for verification), "openAPI-sms" (The SMS message sent using OpenAPI), "openAPI-otp" (Send the one-time password via SMS using OpenAPI) or "inbound" (An inbound SMS message)status string
Get the SMS message details with the particular status. The status value can be "Submitted" (The SMS message has been submitted to the carrier) or "Rejected (The SMS message has been rejected by the carrier). An empty value provided will show the SMS message details with all statuses.carrierStatus string
Get the SMS message details with the particular delivery status in the carrier network. The status value can be "Queued" (The carrier network accepted the SMS message), "Delivered" (The carrier network delivered the SMS message) or "Undelivered" (The carrier network did not deliver the SMS message). An empty value provided will show the SMS message details with all statuses.sender string
The number used to send the SMS message whose details you are required to get. The format is "Country code + Phone number". Example: +85298765432.recipient string
The number used to receive the SMS message whose details you are required to get. The format is "Country code + Phone number". Example: +85298765432.smsID string
The ID of the SMS message. You can input the SMS ID in the this format: {ID1}, {ID2}, {ID3}.
Content-Type string
application/jsonAuthorization string
Bearer AppToken
200
Response body
json400
Response body
object
code integer Defaults to 0
message string
LANGUAGE: Shell
curl --request GET \
--url 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0' \
--header 'Authorization: Bearer AppToken' \
--header 'Content-Type: application/json' \
--header 'accept: application/json'
$ brew install httpie
http GET 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0' \
Authorization:'Bearer AppToken' \
Content-Type:application/json \
accept:application/json
LANGUAGE: Node
$ npm install axios --save
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
}
};
axios
.request(options)
.then(res => console.log(res.data))
.catch(err => console.error(err));
const url = 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0';
const options = {
method: 'GET',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
}
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));
const http = require('https');
const options = {
method: 'GET',
hostname: 'examplebaseurl.com',
port: null,
path: '/v1/api/apps/appID/data/sms-detail?offset=0',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
}
};
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.end();
$ npx api install "@cinnox2021/v7.3#45i1wk2km9l1e4hf"
import cinnox2021 from '@api/cinnox2021';
cinnox2021.getSmsDetails({offset: '0', appID: 'appID', Authorization: 'Bearer AppToken'})
.then(({ data }) => console.log(data))
.catch(err => console.error(err));
LANGUAGE: Ruby
require 'uri'
require 'net/http'
url = URI("https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["Content-Type"] = 'application/json'
request["Authorization"] = 'Bearer AppToken'
response = http.request(request)
puts response.read_body
LANGUAGE: PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer AppToken",
"Content-Type: application/json",
"accept: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
$ composer require guzzlehttp/guzzle
<?php
require_once('vendor/autoload.php');
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0', [
'headers' => [
'Authorization' => 'Bearer AppToken',
'Content-Type' => 'application/json',
'accept' => 'application/json',
],
]);
echo $response->getBody();
LANGUAGE: Python
$ python -m pip install requests
import requests
url = "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0"
headers = {
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer AppToken"
}
response = requests.get(url, headers=headers)
print(response.text)
LANGUAGE: C
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer AppToken");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
LANGUAGE: C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0"),
Headers =
{
{ "accept", "application/json" },
{ "Authorization", "Bearer AppToken" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
$ dotnet add package RestSharp
using RestSharp;
var options = new RestClientOptions("https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("accept", "application/json");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer AppToken");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
LANGUAGE: C++
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);
curl_easy_setopt(hnd, CURLOPT_URL, "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "accept: application/json");
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer AppToken");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
LANGUAGE: Clojure
(require '[clj-http.client :as client])
(client/get "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail" {:headers {:Content-Type "application/json"
:Authorization "Bearer AppToken"}
:query-params {:offset "0"}
:accept :json})
LANGUAGE: Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("accept", "application/json")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer AppToken")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}
LANGUAGE: HTTP
GET /v1/api/apps/appID/data/sms-detail?offset=0 HTTP/1.1
Accept: application/json
Content-Type: application/json
Authorization: Bearer AppToken
Host: examplebaseurl.com
LANGUAGE: Java
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0")
.setHeader("accept", "application/json")
.setHeader("Content-Type", "application/json")
.setHeader("Authorization", "Bearer AppToken")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0"))
.header("accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer AppToken")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0")
.get()
.addHeader("accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer AppToken")
.build();
Response response = client.newCall(request).execute();
HttpResponse<String> response = Unirest.get("https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0")
.header("accept", "application/json")
.header("Content-Type", "application/json")
.header("Authorization", "Bearer AppToken")
.asString();
LANGUAGE: JavaScript
$ npm install axios --save
import axios from 'axios';
const options = {
method: 'GET',
url: 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail',
params: {offset: '0'},
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
}
};
axios
.request(options)
.then(res => console.log(res.data))
.catch(err => console.error(err));
const options = {
method: 'GET',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
}
};
fetch('https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const settings = {
async: true,
crossDomain: true,
url: 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0',
method: 'GET',
headers: {
accept: 'application/json',
'Content-Type': 'application/json',
Authorization: 'Bearer AppToken'
}
};
$.ajax(settings).done(res => {
console.log(res);
});
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0');
xhr.setRequestHeader('accept', 'application/json');
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Authorization', 'Bearer AppToken');
xhr.send(data);
LANGUAGE: JSON
No JSON body
LANGUAGE: Kotlin
val client = OkHttpClient()
val request = Request.Builder()
.url("https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0")
.get()
.addHeader("accept", "application/json")
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer AppToken")
.build()
val response = client.newCall(request).execute()
LANGUAGE: Objectve-C
#import <Foundation/Foundation.h>
NSDictionary *headers = @{ @"accept": @"application/json",
@"Content-Type": @"application/json",
@"Authorization": @"Bearer AppToken" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
LANGUAGE: OCaml
$ opam install cohttp-lwt-unix cohttp-async
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0" in
let headers = Header.add_list (Header.init ()) [
("accept", "application/json");
("Content-Type", "application/json");
("Authorization", "Bearer AppToken");
] in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
LANGUAGE: PowerShell
$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer AppToken")
$response = Invoke-RestMethod -Uri 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0' -Method GET -Headers $headers
$headers=@{}
$headers.Add("accept", "application/json")
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "Bearer AppToken")
$response = Invoke-WebRequest -Uri 'https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail?offset=0' -Method GET -Headers $headers
LANGUAGE: R
library(httr)
url <- "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail"
queryString <- list(offset = "0")
response <- VERB("GET", url, query = queryString, add_headers('Authorization' = 'Bearer AppToken'), content_type("application/octet-stream"), accept("application/json"))
content(response, "text")
LANGUAGE: Swift
import Foundation
let url = URL(string: "https://examplebaseurl.com/v1/api/apps/appID/data/sms-detail")!
var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!
let queryItems: [URLQueryItem] = [
URLQueryItem(name: "offset", value: "0"),
]
components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems
var request = URLRequest(url: components.url!)
request.httpMethod = "GET"
request.timeoutInterval = 10
request.allHTTPHeaderFields = [
"accept": "application/json",
"Content-Type": "application/json",
"Authorization": "Bearer AppToken"
]
let (data, _) = try await URLSession.shared.data(for: request)
print(String(decoding: data, as: UTF8.self))
RESPONSE: 200-Result
{
"code": number,
"result": [
{
"id": "string",
"fromEID": "string",
"date": "string",
"cid": "string",
"sender": "number",
"staffName": "string",
"recipient": "number",
"recipientCountryCode": "string",
"status": "string",
"usage": "string",
"createdAt": "string"
}
]
}
RESPONSE: 400-Result
{
"code": 0,
"message": "error message from server, please refer to error table"
}