GET https://examplebaseURL.com/v1/api/apps/{appID}/tag
| Parameter | Type | Description |
|---|---|---|
| code | Number | Refer to Success and Error Code |
| tags | Array | A list of tags whose information shown includes: * tagID * createAt * basicInfo (Basic information of the tag) * functionType * tagNameLanguageSetting * welcomeMessage * timeOutRepeatMessage * transferFailedMessage * routingRule (Information of the routing rules which determine how the incoming enquiries are distributed to the specific destinations) * chatURL * callURL * metaData * customChannelInfo |
| tags.tagID | String | The ID of the tag from which the information |
| tags.createAt | String | Day and time at which the tag was created |
| tags.basicInfo.tagName | String | The name of the tag |
| tags.basicInfo.tagIcon | String | URL of tags' display icons |
| tags.basicInfo.tagDescription | String | Tags' description |
| tags.functionType | Array of string | A list of the tags' function types Value = CALL (Call), IM (Chat) or CALL (Call) and IM (Chat) |
| tags.tagNameLanguageSetting | Array | It shows a list of the tag's display names and descriptions in different languages. Format: "(Language code in ISO 639-1)":{"displayName":"(Tag's display name in the language)", "description":"(Tag's description in the language)"} Example: "en":{"displayName":"sales", "description":"sales team"} (English adopted as the language code is used for the tag's display name which is sales and for its description which is sales team.) |
| tags.welcomeMessage.enabled | Boolean | If value=false, the welcome message is disabled. If value=true, the welcome message is enabled. |
| tags.welcomeMessage.messageType | String | If welcomeMessage.enabled:true, the welcome message type which should be one of the following: * general (General Message) * buttons (Button) * quickreply (Quick Reply) |
| tags.welcomeMessage.message.title | String | If welcomeMessage.enabled:true, the welcome message's title |
| tags.welcomeMessage.message.description | String | If tags.welcomeMessage.enabled:true, the welcome message's description |
| tags.welcomeMessage.attachment | String | If tags.welcomeMessage.enabled:true, the welcome message's attachment URL |
| tags.welcomeMessage.buttons | Array | It shows the status of the welcome message button including button name, button type and button URL when tags.welcomeMessage.messageType:buttons or quickreply |
| tags.welcomeMessage.buttons.buttonName | String | When tags.welcomeMessage.messageType:buttons or quickreply, buttonName: (The welcome message's button name) |
| tags.welcomeMessage.buttons.buttonType | String | When tags.welcomeMessage.messageType:buttons or quickreply, buttonType: (The button type which should be openLink) |
| tags.welcomeMessage.buttons.buttonURL | String | When tags.welcomeMessage.messageType:buttons or quickreply, buttonURL: (URL of the button) |
| tags.timeOutRepeatMessage.enabled | Boolean | If value=false, the timeout repeat message is disabled. If value=true, the timeout repeat message is enabled. |
| tags.timeOutRepeatMessage.timeoutDuration | String | If timeOutRepeatMessage.enabled:true, idle time that will trigger the system to send a message to the visitor. Format: hh (hours) or mm (minutes). Example: 10m = 10 minutes 3h = 3 hours |
| tags.timeOutRepeatMessage.messageType | String | If tags.timeOutRepeatMessage.enabled:true, the timout repeat message type which should be one of the following: * general (General Message) * buttons (Button) * quickreply (Quick Reply) |
| tags.timeOutRepeatMessage.message.title | String | If tags.timeOutRepeatMessage.enabled:true, the timout repeat message's title |
| tags.timeOutRepeatMessage.message.description | String | If tags.timeOutRepeatMessage.enabled:true, the timout repeat message's description |
| tags.timeOutRepeatMessage.attachment | String | If tags.timeOutRepeatMessage.enabled:true, the timout repeat message's attachment URL |
| tags.timeOutRepeatMessage.buttons | Array | It shows the status of the timeout repeat message button including button name, button type, button URL, tag and staff link when tags.timeOutRepeatMessage.messageType:buttons or quickreply |
| tags.timeOutRepeatMessage.buttons.buttonName | String | When tags.timeOutRepeatMessage.messageType:buttons or quickreply, buttonName:(The message's button name) |
| tags.timeOutRepeatMessage.buttons.buttonType | String | When tags.timeOutRepeatMessage.messageType:buttons or quickreply, buttonType:(A list of button type which should be one of the following: * openLink(Open Link) * transferTag (Transfer) * transferStaff(Transfer) * closeInquiry(Close Enquiry)) |
| tags.timeOutRepeatMessage.buttons.buttonURL | String | When tags.timeOutRepeatMessage.messageType:buttons or quickreply, buttonURL:(URL of openLink) |
| tags.timeOutRepeatMessage.buttons.tag | String | When tags.timeOutRepeatMessage.messageType:buttons or quickreply, tag:(Tag ID when the button type is transferTag) |
| tags.timeOutRepeatMessage.buttons.staff | String | When tags.timeOutRepeatMessage.messageType:buttons or quickreply, staff: (Staff ID when the button type is transferStaff) |
| tags.transferFailedMessage.enabled | Boolean | If value=false, the transfer failed message is disabled. If value=true, the transfer failed message is enabled. |
| tags.transferFailedMessage.messageType | String | When tags.transferFailedMessage.enabled:true, the timout repeat message type which should be one of the following: * general (General Message) * buttons (Button) * quickreply (Quick Reply) |
| tags.transferFailedMessage.message.title | String | When tags.transferFailedMessage.enabled:true, the transfer failed message's title |
| tags.transferFailedMessage.message.description | String | When tags.transferFailedMessage.enabled:true, the transfer failed message's description |
| tags.transferFailedMessage.message.attachment | String | When tags.transferFailedMessage.enabled:true, the transfer failed message's attachment URL |
| tags.transferFailedMessage.buttons | Array | It shows the status of the transfer failed message button including button name, button type, button URL, tag link and staff link when tags.timeFailedMessage.messageType:buttons or quickreply |
| tags.transferFailedMessage.buttons.buttonName | String | When tags.transferFailedMessage.messageType:buttons or quickreply, buttonName:(The message's button name) |
| tags.transferFailedMessage.buttons.buttonType | String | When tags.transferFailedMessage.messageType:buttons or quickreply, buttonType:(button type which should be one of the following: * openLink(Open Link) * transferTag (Transfer) * transferStaff(Transfer) * closeInquiry(Close Enquiry)) |
| tags.transferFailedMessage.buttons.buttonURL | String | When tags.transferFailedMessage.messageType:buttons or quickreply, buttonURL:(URL of openLink) |
| tags.transferFailedMessage.buttons.tag | String | When tags.transferFailedMessage.messageType:buttons or quickreply, tag:(Tag ID when the button type is transferTag) |
| tags.transferFailedMessage.buttons.staff | String | When tags.transferFailedMessage.messageType:buttons orquickreply, staff:(Staff ID when the button type is transferStaff) |
| tags.closingMessage.enabled | Boolean | If value=false, the close enquiry message is disabled. If value=true, the close enquiry message is enabled. |
| tags.closingMessage.messageType | String | If tags.closingMessage.enabled:true, the close enquiry message type which should be general (General Message) or buttons (Button). |
| tags.closingMessage.message.title | String | If tags.closingMessage.enabled:true, the close enquiry message's title. |
| tags.closingMessage.message.description | String | If tags.closingMessage.enabled:true, the close enquiry message's description. |
| tags.closingMessage.attachment | String | If tags.closingMessage.enabled:true, the the close enquiry message's attachment URL. |
| tags.closingMessage.buttons | Array | It shows the status of the closing message button including button name, button type and button URL when tags.closingMessage.messageType:buttons. |
| tags.closingMessage.buttons.buttonType | String | When tags.closingMessage.messageType:buttons, tags.closingMessage.buttons.buttonType:openLink (Open Link). |
| tags.closingMessage.buttons.buttonName | String | When tags.closingMessage.messageType:buttons, tags.closingMessage.buttons.buttonName:(The message's button name). |
| tags.closingMessage.buttons.buttonURL | String | When tags.closingMessage.messageType:buttons, closingMessage.buttons.buttonURL:(URL of openLink) |
| tags.routingRule.alternativeRouting.alternativeDestinations | Array | A list of destination ID for the alternative routing |
| tags.routingRule.timeRouting.schedules.days | Array | A list of the scheduled day of the time routing. Value= Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and/or Sunday. |
| tags.routingRule.timeRouting.schedules.from | String | It is the starting time of the scheduled day of the time routing. (This time setting is based on your device time zone and time format: 24-hour notation in the form of HH:MM, based on your device time zone.) |
| tags.routingRule.timeRouting.schedules.to | String | It is the end time of the scheduled day of the time routing. (This time setting is based on your device time zone and time format: 24-hour notation in the form of HH:MM, based on your device time zone.) |
| tags.routingRule.timeRouting.schedules.destinations | Array | It is a list of destination ID of the time schedule |
| tags.routingRule.timeRouting.schedules.subPercentageRouting.schedules.percentage | Integer | Return when the percentage layer added. It is the percentage of the distribution of the incoming enquiries. |
| tags.routingRule.timeRouting.schedules.subPercentageRouting.schedules.destinations | Array | Return when the percentage layer added. It is a list of destination ID of the group of staff dedicated to answering the enquires based on the routing percentage. |
| tags.routingRule.timeRouting.schedules.subPercentageRouting.otherSchedule.destinations | Array | Return when the percentage layer added. It is a list of destination ID of the group of staff dedicated to answering the remaing enquires based on the sub-percentage routing. |
| tags.routingRule.timeRouting.otherSchedule.destinations | Array | Return when the time routing has been enaled It is the list of the destination ID of the group of staff dedicated to answering the remaining enquires distributed based on the time routing rule. |
| tags.routingRule.percentageRouting.schedules.percentage | Integer | When Percentage routing has been selected. It is the percentage of the distribution of the incoming enquiries. |
| tags.routingRule.percentageRouting.schedules.destinations | Array | It is a list of destination ID of the percentage schedule |
| tags.routingRule.percentageRouting.schedules.subTimeRouting.schedules.days | Array | When time layer added It is a list of the scheduled day of the sub-time routing. Value= Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and/or Sunday. |
| tags.routingRule.percentageRouting.schedules.subTimeRouting.schedules.from | String | When time layer added. It is the starting time of the scheduled day of the sub-time routing. (This time setting is based on your device time zone and time format: 24-hour notation in the form of HH:MM, based on your device time zone.) |
| tags.routingRule.percentageRouting.schedules.subTimeRouting.schedules.to | String | When time layer added. It is the end time of the scheduled day of the sub-time routing. (This time setting is based on your device time zone and time format: 24-hour notation in the form of HH:MM, based on your device time zone.) |
| tags.routingRule.percentageRouting.schedules.subTimeRouting.schedules.destinations | Array | When time layer added. It is the list of the destination ID of the group of staff dedicated to answering the enquires distributed based on the sub-time routing rule. |
| tags.routingRule.percentageRouting.schedules.subTimeRouting.otherSchedule.destinations | Array | When time layer added. It is the list of the destination ID of the group of staff dedicated to answering the remaining enquires distributed based on the sub-time routing rule. |
| tags.routingRule.percentageRouting.otherSchedule.destinations | Array | When percentage routing has been selected. It is the list of the destination ID of the group of staff dedicated to answering the remaining enquires distributed based on the percentage routing rule. |
| tags.stickyRouting | Boolean | Value = true. Bind a visitor to the staff who handled their enquiry using this tag. Value = false. Do not bind a visitor to the staff who handled their enquiry using this tag. |
| tags.chatURL | String | The chat URL of the tag |
| tags.callURL | String | The call URL of the tag |
| tags.metaData | Array | A list of keywords to be triggered as criteria to show or hide the tag. |
| tags.customChannelInfo.enabled | Boolean | Value = true (enable the custom channel info) Value = false (disable the custom channel info) |
| tags.customChannelInfo.description | String | The content of the custom channel info. |
📘 Notices
- tags.routingRule.alternativeRouting object will only be shown when the user selects the alternative routing.
- tags.routingRule.timeRouting object will only be shown when the user selects the time routing.
- tags.routingRule.timeRouting.schedules.subPercentageRouting object will only be shown when the user adds the percentage layer.
- tags.routingRule.percentageRouting will only be shown when the user selected the percentage routing.
- tags.routingrule.percentageRouting.schedules.subTimeRouting object will only be shown when the user adds the time layer.
- tags.timeOutRepeatMessage.buttons.staff will only be shown when the user selects the transfer as the button type and the staff name as the destination in the idle message setting.
- tags.timeOutRepeatMessage.buttons.tag will only be shown when the user selects the transfer as the button type and the tag name as the destination in the idle message setting.
- tags.transferFailedMessage.buttons.staff will only be shown when the user selects the transfer as the button type and the staff name as the destination in the transfer failed message setting.
- tags.transferFailedMessage.buttons.tag will only be shown when the user selects the transfer as the button type, and the tag name as the destination in the transfer failed message setting.
appID string required
App ID
offset int32 Defaults to 0
Skip {offset} number of data.limit int32 Defaults to 50
Return {limit} number of data. Default limit (50), max:500.id string
ID of the tag whose information you are required to get. Input the Tag ID for a single record query for this tag.name string
The name of the tag whose information you are required to get. Input the tag name for a single record query for this tag.
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/tag?offset=0&limit=50' \
--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/tag?offset=0&limit=50' \
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/tag?offset=0&limit=50',
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/tag?offset=0&limit=50';
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/tag?offset=0&limit=50',
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.getTagList({offset: '0', limit: '50', 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/tag?offset=0&limit=50")
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/tag?offset=0&limit=50",
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/tag?offset=0&limit=50', [
'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/tag?offset=0&limit=50"
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/tag?offset=0&limit=50");
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 RestSharp;
var options = new RestClientOptions("https://examplebaseurl.com/v1/api/apps/appID/tag?offset=0&limit=50");
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);
$ dotnet add package RestSharp
using RestSharp;
var options = new RestClientOptions("https://examplebaseurl.com/v1/api/apps/appID/tag?offset=0&limit=50");
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/tag?offset=0&limit=50");
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/tag" {:headers {:Content-Type "application/json"
:Authorization "Bearer AppToken"}
:query-params {:offset "0"
:limit "50"}
:accept :json})
LANGUAGE: Go
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://examplebaseurl.com/v1/api/apps/appID/tag?offset=0&limit=50"
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/tag?offset=0&limit=50 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/tag?offset=0&limit=50")
.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/tag?offset=0&limit=50"))
.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/tag?offset=0&limit=50")
.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/tag?offset=0&limit=50")
.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/tag',
params: {offset: '0', limit: '50'},
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/tag?offset=0&limit=50', 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/tag?offset=0&limit=50',
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/tag?offset=0&limit=50');
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/tag?offset=0&limit=50")
.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/tag?offset=0&limit=50"]
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/tag?offset=0&limit=50" 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/tag?offset=0&limit=50' -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/tag?offset=0&limit=50' -Method GET -Headers $headers
LANGUAGE: R
library(httr)
url <- "https://examplebaseurl.com/v1/api/apps/appID/tag"
queryString <- list(
offset = "0",
limit = "50"
)
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/tag")!
var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!
let queryItems: [URLQueryItem] = [
URLQueryItem(name: "offset", value: "0"),
URLQueryItem(name: "limit", value: "50"),
]
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": {
"tags": [
{
"tagID": "string",
"createAt": "string",
"basicInfo": {
"tagName": "test",
"tagIcon": "string",
"tagDescription": "string"
},
"functionType": [
"array of string"
],
"tagNameLanguageSetting": {
"(language code)": {
"displayName": "string",
"description": "string"
},
},
"welcomeMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string"
}
]
},
"timeOutRepeatMessage": {
"enabled": boolean,
"timeoutDuration": "string",
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"transferFailedMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"routingRule": {
"alternativeRouting": {
"alternativeDestinations": [
"string"
]
},
"chatURL": "string",
"callURL": "string",
"metaData": ["string"],
"customChannelInfo": {
"enabled": boolean,
"description": "string"
}
}
}
]
}
}
{
"code": number,
"result": {
"tags": [
{
"tagID": "string",
"createAt": "string",
"basicInfo": {
"tagName": "test",
"tagIcon": "string",
"tagDescription": "string"
},
"functionType": [
"array of string"
],
"tagNameLanguageSetting": {
"(language code)": {
"displayName": "string",
"description": "string"
},
},
"welcomeMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string"
}
]
},
"timeoutRepeatMessage": {
"enabled": boolean,
"timeoutDuration": "string",
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"transferFailedMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"routingRule": {
"timeRouting": {
"schedules": [
{
"from": "string",
"to": "string",
"days": [
"string"
],
"destinations": [
"string"
]
}
],
"otherSchedule": {
"destinations": [
"string"
]
}
}
},
"chatURL": "string",
"callURL": "string",
"metaData": ["string"],
"customChannelInfo": {
"enabled": boolean,
"description": "string"
}
}
]
}
}
{
"code": number,
"result": {
"tags": [
{
"tagID": "string",
"createAt": "string",
"basicInfo": {
"tagName": "test",
"tagIcon": "string",
"tagDescription": "string"
},
"functionType": [
"array of string"
],
"tagNameLanguageSetting": {
"(language code)": {
"displayName": "string",
"description": "string"
},
},
"welcomeMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string"
}
]
},
"timeoutRepeatMessage": {
"enabled": boolean,
"timeoutDuration": "string",
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"transferFailedMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"routingRule": {
"timeRouting": {
"schedules": [
{
"from": "string",
"to": "string",
"days": [
"string"
],
"subPercentageRouting": {
"schedules": [
{
"percentage": int,
"destinations": [
"string"
]
}
],
"otherSchedule": {
"destinations": [
"string"
]
}
}
}
],
"otherSchedule": {
"destinations": [
"string"
]
}
}
},
"chatURL": "string",
"callURL": "string",
"metaData": ["string"],
"customChannelInfo": {
"enabled": boolean,
"description": "string"
}
}
]
}
}
{
"code": number,
"result": {
"tags": [
{
"tagID": "string",
"createAt": "string",
"basicInfo": {
"tagName": "test",
"tagIcon": "string",
"tagDescription": "string"
},
"functionType": [
"array of string"
],
"tagNameLanguageSetting": {
"(language code)": {
"displayName": "string",
"description": "string"
},
},
"welcomeMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string"
}
]
},
"timeoutRepeatMessage": {
"enabled": boolean,
"timeoutDuration": "string",
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"transferFailedMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"routingRule": {
"percentageRouting": {
"schedules": [
{
"percentage": int,
"destinations": [
"string"
]
}
],
"otherSchedule": {
"destinations": [
"string"
]
}
}
},
"chatURL": "string",
"callURL": "string",
"metaData": ["string"],
"customChannelInfo": {
"enabled": boolean,
"description": "string"
}
}
]
}
}
{
"code": number,
"result": {
"tags": [
{
"tagID": "string",
"createAt": "string",
"basicInfo": {
"tagName": "test",
"tagIcon": "string",
"tagDescription": "string"
},
"functionType": [
"array of string"
],
"tagNameLanguageSetting": {
"(language code)": {
"displayName": "string",
"description": "string"
},
},
"welcomeMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string"
}
]
},
"timeoutRepeatMessage": {
"enabled": boolean,
"timeoutDuration": "string",
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"transferFailedMessage": {
"enabled": boolean,
"messageType": "string",
"message": {
"title": "string",
"description": "string"
},
"attachment": "string",
"buttons": [
{
"buttonName": "string",
"buttonType": "string",
"buttonURL": "string",
"tag": "string",
"staff": "string"
}
]
},
"routingRule": {
"percentageRouting": {
"schedules": [
{
"percentage": int,
"subTimeRouting": {
"schedules":[
{
"from": "string",
"to": "string",
"days": [
"string"
],
"destinations": [
"string"
]
}
],
"otherSchedule":{
"destinations":[
"string"
]
}
}
}
],
"otherSchedule": {
"destinations": [
"string"
]
}
}
},
"chatURL": "string",
"callURL": "string",
"metaData": ["string"],
"customChannelInfo": {
"enabled": boolean,
"description": "string"
}
}
]
}
}
RESPONSE: 400-Result
{
"code": 0,
"message": "The error message from the server. Please refer to the error table."
}