Getting Started
Introduction
Welcome to the Pasifik API V2 document! You can use our API to access Pasifik API endpoints, which can get information on various of services.
This document will provide instructions on how to quickly integrate Pasifik Telekom services into various solutions by using Pasifik HTTP application programming interface (HTTP API). The HTTP API can be used for sending SMS, and watching telephones or your PBX activities, send and receive Fax, collecting delivery reports, check your balance. Pasifik’s API is based on REST standards, enabling you to use your browser for accessing URLs. In order to interact with our API, any HTTP client in any programming language can be used.
We have language bindings in Shell, PHP, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Base URL
Submit all requests to the base URL. All the requests are submitted thorough HTTP POST, PUT or GET method. Although you can use HTTP protocol, we strongly recommend you to submit all requests to Pasifik SMS API over HTTPS so the traffic is encrypted and the privacy is ensured.
Http Headers
Pasifik SMS API supports JSON and XML Content-Types and Accept criteria that should be specified in the header. If the Content-Type is not specified you will receive a General error. Depending which Accept type is chosen in the deader for the request, the same one will be applied in the response.
Content-Type: application/json
Accept: application/json
Content-Type: application/xml
Accept: application/xml
Authentication
We support basic authorization using a username and password with Base64 encoding variation RFC2045-MIME.
The authorization header is constructed as follows:
- Username and password are combined into a string
username:password
. - The resulting string is encoded using the RFC2045-MIME variant of Base64.
Example:
- Username:
Aladdin
- Password:
open sesame
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
SMS
In a few simple steps, we will explain how to send an SMS using Pasifik HTTP API. The message will be sent only to a valid phone number (numbers), written in international format e.g. 41793026727.
Phone numbers format We strongly recommend using the E.164 number formatting. E.164 numbers are internationally standardized to a fifteen digit maximum length. Phone numbers are usually prefixed with + (plus sign), followed by a country code, network code and the subscriber number. Phone numbers that are not E.164 formatted may work, depending on the handset or network.
Submit SMS
- Submit: send one SMS to many numbers.
- Submit Multi: send many SMS to many numbers.
Query SMS
- Query Multi: get General Report by Date Time range (start_date, end_date).
- Query Multi By ID: get General Report by ID.
- Query: get Detailed Report by ID.
Http Header
POST /en/api/ HTTP/1.1
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
Your Http Header should contains 3 authorization
, content-type
and accept
.
Submit
Here you send one SMS to many receipients.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/sms/submit/
Request Body
contains the message you wish to send with from, to and text parameters.
POST /en/api/sms/submit/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"from":"YOURCOMPANY",
"to":"905399999999,905399999998",
"text":"My first Pasifik SMS"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "123456",
"code": "200",
"description": "OK"
}
{
"from":"YOURCOMPANY",
"to":"905399999999,905399999998",
"text":"My first text SMS."
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"from":"YOURCOMPANY",
"to":"905999999998,905999999999",
"text":"My first text SMS."
}' https://oim.pasifiktelekom.com.tr/en/api/sms/submit/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/sms/submit/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"from":"YOURCOMPANY",
"to":"905999999998,905999999999",
"text":"My first text SMS."
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"from\":\"YOURCOMPANY\",\"to\":\"905999999998,905999999999\",\"text\":\"My first text SMS.\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"from\":\"YOURCOMPANY\",\"to\":\"905999999998,905999999999\",\"text\":\"My first text SMS.\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/sms/submit/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"from\":\"YOURCOMPANY\",\"to\":\"905999999998,905999999999\",\"text\":\"My first text SMS.\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"from\":\"YOURCOMPANY\", \"to\":\"905999999998,905999999999\",\"text\":\"My first text SMS.\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"from": "YOURCOMPANY",
"to": "905999999998,905999999999",
"text": "My first text SMS."
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/sms/submit/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Query Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
from | string | - | Yes | "YOURCOMPANY" max: 11, min: 3, based on your trade mark name. |
to | string | - | Yes | "905399999999" your destination phone number, it could be multiple and seperated by , e.g. “905399999999,905399999998”. |
text | string | - | Yes | "My First Text Message" it is based on character set used in the SMS. |
universal | boolean | false | No | when universal = true this tell us this sms will sent abroad to another country. |
alphabet | string | “Default” | No | it is charset of message text [“Default”, “TurkishSingleShift”, “DefaultMclass0”, “UCS2”]. |
scheduled_delivery_time | string | currentDatetime |
No | SMS scheduling Datetime "%Y-%m-%dT%H:%M:%SZ" // e.g "2016-07-23T21:54:02Z" in UTC Timezone . |
period | integer | 1440 | No | The maximum validity period is 24 hours (1440 minutes). |
Submit Multi
Send many SMS to many receipients.
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/
POST /en/api/sms/submit/multi/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"from": "YOURCOMPANY",
"envelopes": [
{
"to": "905999999998",
"text": "SMS test 1"
}, {
"to": "905999999999",
"text": "SMS test 2"
}
]
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "123456",
"code": "200",
"description": "OK"
}
{
"from": "YOURCOMPANY",
"envelopes": [
{
"to": "905999999998",
"text": "SMS test 1"
}, {
"to": "905999999999",
"text": "SMS test 2"
}
]
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"from":"YOURCOMPANY",
"envelopes": [{"to": "905999999998", "text": "SMS test 1"},{"to": "905999999999", "text": "SMS test 2"}]
}' https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"from":"YOURCOMPANY",
"envelopes": [{"to": "905999999998", "text": "SMS test 1"},{"to": "905999999999", "text": "SMS test 2"}]
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"from\":\"YOURCOMPANY\",\"envelopes\": [{\"to\": \"905999999998\", \"text\": \"SMS test 1\"},{\"to\": \"905999999999\", \"text\": \"SMS test 2\"}]}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"from\":\"YOURCOMPANY\",\"envelopes\": [{\"to\": \"905999999998\", \"text\": \"SMS test 1\"},{\"to\": \"905999999999\", \"text\": \"SMS test 2\"}]}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/sms/submit/multi/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"from\":\"YOURCOMPANY\",\"envelopes\": [{\"to\": \"905999999998\", \"text\": \"SMS test 1\"},{\"to\": \"905999999999\", \"text\": \"SMS test 2\"}]}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"from\":\"YOURCOMPANY\", \"envelopes\": [{\"to\": \"905999999998\", \"text\": \"SMS test 1\"},{\"to\": \"905999999999\", \"text\": \"SMS test 2\"}]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"from": "YOURCOMPANY",
"envelopes": [
{
"to": "905999999998",
"text": "SMS test 1"
}, {
"to": "905999999999",
"text": "SMS test 2"
}
]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Query Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
from | string | - | Yes | "YOURCOMPANY" max: 11, min: 3, based on your trade mark name. |
envelopes | array of dictionaries | - | Yes | Array of message text and destination address to , every message has only one destination. |
to | string | - | Yes | "905399999999" your only one destination phone number. |
text | string | - | Yes | "My First Text Message" it is based on character set used in the SMS. |
universal | boolean | false | No | when universal = true this tell us this sms will sent abroad to another country. |
alphabet | string | “Default” | No | it is charset of message text [“Default”, “TurkishSingleShift”, “DefaultMclass0”, “UCS2”]. |
scheduled_delivery_time | string | currentDatetime |
No | SMS scheduling Datetime "%Y-%m-%dT%H:%M:%SZ" // e.g "2016-07-23T21:54:02Z" in UTC Timezone . |
period | integer | 1440 | No | The maximum validity period is 24 hours (1440 minutes). |
Submit Advanced SMS
POST /en/api/sms/submit/multi/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"from": "YOURCOMPANY",
"envelopes": [
{
"to": "+499999999999",
"text": "أنا أحب اللغة العربية"
},
{
"to": "+19999999999",
"text": "メッセージありがとうございます"
}
],
"alphabet": "UCS2",
"universal": true
}
{
"from": "YOURCOMPANY",
"envelopes": [
{
"to": "+499999999999",
"text": "أنا أحب اللغة العربية"
},
{
"to": "+19999999999",
"text": "メッセージありがとうございます"
}
],
"alphabet": "UCS2",
"universal": true
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"from":"YOURCOMPANY",
"envelopes": [{"to": "+499999999999", "text": "أنا أحب اللغة العربية"},{"to": "+19999999999", "text": "メッセージありがとうございます"}],
"alphabet": "UCS2",
"universal": true
}' https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"from":"YOURCOMPANY",
"envelopes": [{"to": "+499999999999", "text": "أنا أحب اللغة العربية"},{"to": "+19999999999", "text": "メッセージありがとうございます"}],
"alphabet": "UCS2",
"universal": true
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"from\":\"YOURCOMPANY\",\"envelopes\": [{\"to\": \"+499999999999\", \"text\": \"أنا أحب اللغة العربية\"},{\"to\": \"+19999999999\", \"text\": \"メッセージありがとうございます\"}], \"alphabet\": \"UCS2\", \"universal\": true }"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"from\":\"YOURCOMPANY\",\"envelopes\": [{\"to\": \"+499999999999\", \"text\": \"أنا أحب اللغة العربية\"},{\"to\": \"+19999999999\", \"text\": \"メッセージありがとうございます\"}], \"alphabet\": \"UCS2\", \"universal\": true }"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/sms/submit/multi/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"from\":\"YOURCOMPANY\",\"envelopes\": [{\"to\": \"+499999999999\", \"text\": \"أنا أحب اللغة العربية\"},{\"to\": \"+19999999999\", \"text\": \"メッセージありがとうございます\"}], \"alphabet\": \"UCS2\", \"universal\": true }")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"from\":\"YOURCOMPANY\", \"envelopes\": [{\"to\": \"+499999999999\", \"text\": \"أنا أحب اللغة العربية\"},{\"to\": \"+19999999999\", \"text\": \"メッセージありがとうございます\"}], \"alphabet\": \"UCS2\", \"universal\": true }", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"from": "YOURCOMPANY",
"envelopes": [
{
"to": "+499999999999",
"text": "أنا أحب اللغة العربية"
}, {
"to": "+19999999999",
"text": "メッセージありがとうございます"
}
],
"alphabet": "UCS2",
"universal": true
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/sms/submit/multi/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
International SMS
Universal SMS now you can send sms outside of country, and that is useful for Travel Agency, or Hotel Reservation. we made it simple "universal"
boolean field. just set it as true
.
and make sure you should prefix it with +
e.g. "+19999999999"
.
"universal": true
Alphabet
Turkish SMS In your SMS business usage, you might have noticed that if your text contains characters specific to your country’s alphabet, the number of remaining SMS characters drops to just 70. Your business has the option of creating & sending long messages but you don’t really like the cost of doing so, do you? National Language Identifier is an encoding technology which allows an SMS containing language specific characters usually treated as 16bit Unicode to be delivered as original text, while only deducting 5 characters from the maximum SMS length – 155 characters allowed. Stay true to your language by sending Fully featured textual message and setting "alphabet":"TurkishSingleShift"
.
Flash SMS Besides standard SMS message, you are able to send flash messages over Fully featured textual message API method. Flash SMS will pop-up on the user’s phone when it’s received. Message can be stored on the mobile phone and has a sender ID. In order to send flash message, set "alphabet":"DefaultMclass0"
.
Unicode SMS Unicode (UTF-8) messages can be sent by textual Send SMS method, This method support all universal language Chinese, Japanese, Arabic, Greek and all non-GSM characters under Unicode, the text of the message is limited to 70 characters. Here you can find what characters are included in GSM set, set "alphabet":"UCS2"
.
Schedule SMS and Validity period
POST /en/api/sms/submit/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"from": "YOURCOMPANY",
"to": "905999999999",
"text": "The time-traveling is just too dangerous.
Better that I devote myself to study the other great mystery of the universe: women!",
"scheduled_delivery_time": "2016-07-23T21:54:02Z",
"period": 1440
}
{
"from": "YOURCOMPANY",
"to": "905999999999",
"text": "The time-traveling is just too dangerous.
Better that I devote myself to study the other great mystery of the universe: women!",
"scheduled_delivery_time": "2016-07-23T21:54:02Z",
"period": 1440
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"from":"YOURCOMPANY",
"to":"905999999999",
"text": "The time-traveling is just too dangerous.
Better that I devote myself to study the other great mystery of the universe: women!",
"scheduled_delivery_time": "2016-07-23T21:54:02Z",
"period": 1440
}' https://oim.pasifiktelekom.com.tr/en/api/sms/submit/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/sms/submit/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"from":"YOURCOMPANY",
"to":"905999999999",
"text": "The time-traveling is just too dangerous.
Better that I devote myself to study the other great mystery of the universe: women!",
"scheduled_delivery_time": "2016-07-23T21:54:02Z",
"period": 1440
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"from\":\"YOURCOMPANY\",\"to\":\"905999999999\", \"text\": \"The time-traveling is just too dangerous. Better that I devote myself to study the other great mystery of the universe: women!\", \"scheduled_delivery_time\": \"2016-07-23T21:54:02Z\", \"period\": 1440}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"from\":\"YOURCOMPANY\",\"to\":\"905999999999\", \"text\": \"The time-traveling is just too dangerous. Better that I devote myself to study the other great mystery of the universe: women!\", \"scheduled_delivery_time\": \"2016-07-23T21:54:02Z\", \"period\": 1440}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/sms/submit/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"from\":\"YOURCOMPANY\",\"to\":\"905999999999\", \"text\": \"The time-traveling is just too dangerous. Better that I devote myself to study the other great mystery of the universe: women!\", \"scheduled_delivery_time\": \"2016-07-23T21:54:02Z\", \"period\": 1440}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/sms/submit/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"from\":\"YOURCOMPANY\", \"to\":\"905999999999\", \"text\": \"The time-traveling is just too dangerous. Better that I devote myself to study the other great mystery of the universe: women!\", \"scheduled_delivery_time\": \"2016-07-23T21:54:02Z\", \"period\": 1440}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"from": "YOURCOMPANY",
"to": "905999999999",
"text": "The time-traveling is just too dangerous. Better that I devote myself to study the other great mystery of the universe: women!",
"scheduled_delivery_time": "2016-07-23T21:54:02Z",
"period": 1440
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/sms/submit/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Schedule SMS sending and set a validity period for your messages. If you want to schedule your SMS to be sent later you can use "scheduled_delivery_time"
parameter in the Fully featured textual message API method. This will set a specific date and time when the message will be sent.
Date and time format for SMS scheduling "%Y-%m-%dT%H:%M:%SZ" // e.g "2016-07-23T21:54:02Z" in UTC Timezone.
.
"scheduled_delivery_time": "2016-07-23T21:54:02Z"
Besides scheduling messages, you can also set validity period for every SMS sent over Fully featured textual message API method. The message "period"
parameter should be set in minutes as integer. The message sending will not be allowed after the set period expires. The maximum validity period is 24 hours and if you put a longer period, we will automatically set it to 24h.
"period": 1440
Query Multi
POST /en/api/sms/query/multi/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"count": "4",
"sender": "YOURCOMPANY",
"succeeded": true,
"created": "12.03.2016 - 19:58",
"waiting_count": "0",
"delivered_count": "3",
"cost": "0.024",
"message": "Test SMS 1",
"undelivered_count": "1",
"sms_id": 123456
}, {
"count": "1",
"sender": "YOURCOMPANY",
"succeeded": true,
"created": "12.03.2016 - 19:56",
"waiting_count": "0",
"delivered_count": "1",
"cost": "0.024",
"message": "Test SMS here.",
"undelivered_count": "0",
"sms_id": 123457
}
]
{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}' https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/sms/query/multi/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"start_date": "01.03.2016",
"end_date": "14.03.2016"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get query of General Report
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/
Query Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
start_date | string | - | Yes | Date string format formated as turkish date time format “%d.%m.%Y” e.g. “01.03.2016”. |
end_date | string | - | Yes | Date string format formated as turkish date time format “%d.%m.%Y” e.g. “14.03.2016”. |
If the request is syntactically correct, response header HTTP status code will be 200 OK and the response will contain array with logs matching given filter. If you try to get logs without authorization, you will receive an error 401 Unauthorized. If your request is syntactically incorrect, you will receive an error 400 Bad Request.
Query Multi By Id
POST /en/api/sms/query/multi/id/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"sms_id": "123456"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"count": "4",
"sender": "YOURCOMPANY",
"succeeded": true,
"created": "12.03.2016 - 19:58",
"waiting_count": "0",
"delivered_count": "3",
"cost": "0.024",
"message": "deneme",
"undelivered_count": "1",
"sms_id": 123456
}
{
"sms_id": "123456"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"sms_id": "123456"
}' https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/id/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/id/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"sms_id": "123456"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/id/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"sms_id\": \"123456\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"sms_id\": \"123456\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/sms/query/multi/id/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/id/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"sms_id\": \"123456\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/id/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"sms_id\": \"123456\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"sms_id": "123456"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/id/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get query of General Report By ID
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/sms/query/multi/id/
Query Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
sms_id | string | - | Yes | SMS response ID to check your sent sms. |
Query
POST /en/api/sms/query/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"sms_id": "123456"
}
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"network": 1086,
"sequence": 0,
"msisdn": "5399999999",
"xser": "",
"lastupdated": "12.03.2016 - 19:58",
"errorcode": "It was delivered",
"state": "Delivered",
"cost": 1.0,
"submitted": "12.03.2016 - 19:58",
"payload": "Test 1",
"sms_id": 123456
}, {
"network": 1087,
"sequence": 0,
"msisdn": "5399999998",
"xser": "",
"lastupdated": "12.03.2016 - 19:58",
"errorcode": "It was delivered",
"state": "Delivered",
"cost": 1.0,
"submitted": "12.03.2016 - 19:58",
"payload": "Test 2",
"sms_id": 123456
}
]
{
"sms_id": "123456"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"sms_id": "123456"
}' https://oim.pasifiktelekom.com.tr/en/api/sms/query/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/sms/query/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"sms_id": "123456"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/sms/query/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"sms_id\": \"123456\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"sms_id\": \"123456\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/sms/query/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/sms/query/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"sms_id\": \"123456\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/sms/query/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"sms_id\": \"123456\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"sms_id": "123456"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/sms/query/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get query of Detailed Report By ID.
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/sms/query/
Query Parameters
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
sms_id | string | - | Yes | SMS response ID to check your sent sms. |
User
This method allows you to get your account balance and settings.
Get Settings
POST /en/api/user/getsettings/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{}
HTTP/1.1 200 OK
Content-Type: application/json
{
"username": "YOURUSERNAME",
"tel_balance_pkt": 0,
"tel_account_list": [252, 230, 223],
"undelivered_all": 0,
"delivered_all": 65,
"sms_balance_pkt": 454,
"waiting_all": 0,
"currency": "TRY",
"count_all": 65,
"fullname": "Will Smith",
"balance": 718.21
}
This is important to get your account information, your balance and more.
Notice: no params required.
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/user/getsettings/
Query Parameters
There is no parameters.
Telephone
Telephone API is available as monitoring status, get CDR report, watch live calls. it can be integrated with CRM Systems. it contains:
History
- History: get general report or A call detail record (CDR) Report in voice over IP.
Live
- Live: get Live calls of your telephones.
- Live Disconnect: disconnect one live call immediately.
Call History
POST /en/api/tel/history/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"i_account": 12345
}
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"accessibility_cost": 0.0,
"protocol": "SIP",
"connect_time": "11:57:29.000 GMT Fri Dec 11 2015",
"prefix": "B001",
"cost": 0.0,
"result": 0,
"duration": 0.0,
"interval_1": 0,
"cli": "02169999999",
"pdd1xx": 3.986608639,
"cld": "B001905999999999",
"i_cdr": 17950808,
"call_id": "605624fe10d3fb8e5a0c5eda5dd76122@1.1.1.1",
"delay": 7.0,
"cld_in": "05999999999",
"i_call": 17950847,
"free_seconds": 0,
"post_call_surcharge": 0.0,
"i_account": 123456,
"i_protocol": 1,
"disconnect_time": "11:57:29.000 GMT Fri Dec 11 2015",
"price_1": 0.0,
"description": "PASIFIK TELEKOM",
"interval_n": 60,
"remote_ip": "1.1.1.1",
"area_name": "",
"connect_fee": 0.0,
"remote_party_id": "",
"release_source": "caller",
"plan_duration": 0.0,
"grace_period": 0,
"cli_in": "908599999999",
"billed_duration": 0.0,
"country": "TURKEY",
"lrn_cld": "",
"p_asserted_id": "",
"user_agent": "Asterisk PBX",
"lrn_cld_in": "",
"price_n": 0.09
}, {
"accessibility_cost": 0.0,
"protocol": "SIP",
"connect_time": "11:56:03.000 GMT Fri Dec 11 2015",
"prefix": "B001",
"cost": 0.09,
"result": 0,
"duration": 36.0,
"interval_1": 0,
"cli": "02169999999",
"pdd1xx": 7.032889127,
"cld": "B001905999999999",
"i_cdr": 17950807,
"call_id": "7c1b58806de5f5b941b7282b0abea9e0@1.1.1.1",
"delay": 22.0,
"cld_in": "05999999999",
"i_call": 17950844,
"free_seconds": 0,
"post_call_surcharge": 0.0,
"i_account": 123456,
"i_protocol": 1,
"disconnect_time": "11:56:39.000 GMT Fri Dec 11 2015",
"price_1": 0.0,
"description": "PASIFIK TELEKOM",
"interval_n": 60,
"remote_ip": "1.1.1.1",
"area_name": "",
"connect_fee": 0.0,
"remote_party_id": "",
"release_source": "caller",
"plan_duration": 0.0,
"grace_period": 0,
"cli_in": "908599999999",
"billed_duration": 60.0,
"country": "TURKEY",
"lrn_cld": "",
"p_asserted_id": "",
"user_agent": "Asterisk PBX",
"lrn_cld_in": "",
"price_n": 0.09
}
]
{
"i_account": 12345
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"i_account": 12345
}' https://oim.pasifiktelekom.com.tr/en/api/tel/history/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/tel/history/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"i_account": 12345
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/tel/history/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"i_account\": 12345}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"i_account\": 12345}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/tel/history/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/tel/history/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"i_account\": 12345}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/tel/history/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"i_account\": 12345}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"i_account": 12345
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/tel/history/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Call History: get general report (CDR report).
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/tel/history/
Request Body
contains cdr report that you made by your telephone account by i_account
.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
i_account | integer | - | Yes | your telephone account ID. |
start_date | string | - | No | Datetime string formated as “%Y-%m-%dT%H:%M:%SZ”, e.g. “2016-09-01T10:12:45Z” in UTC Timezone. |
end_date | string | - | No | Datetime string formated as “%Y-%m-%dT%H:%M:%SZ”, e.g. “2016-09-01T10:12:45Z” in UTC Timezone. |
cli | string | - | No | the Caller Line Identification, or source call for “caller” and “calling”, e.g. “902169999999”, you can use “%08509999999” for searching. |
cld | string | - | No | the Caller Line Display, or destination call, e.g. “902129999999”, you can use “%02169999999” for searching. |
type | string | - | No | type used for filtering call types (type of fetched CDRs), ["non_zero_and_errors", "non_zero", "all", "complete", "incomplete", "errors"] . |
offset | integer | 0 | No | skip fist offset CDRs. |
limit | integer | - | No | return only limit CDRs. |
Type Filtering
Name | Description |
---|---|
non_zero_and_errors | return only non-zero duration and errors CDRs. |
non_zero | return only non-zero duration CDRs. |
all | return all CDRs. |
complete | return only CDRs of completed calls. |
incomplete | return only CDRs of incomplete calls. |
errors | return errors CDRs. |
Response Body
Parameter | Type | Description |
---|---|---|
i_account | Integer | i_account of account. |
setup_time | String | setup time of call in ’%H:%M:%S.000 GMT %a %b %d %Y’ format (e.g. 09:57:29.000 GMT Wed Nov 18 2009), (deprecated). |
connect_time | String | connect time of call in ’%H:%M:%S.000 GMT %a %b %d %Y’ format (e.g. 09:57:29.000 GMT Wed Nov 18 2009). |
billed_duration | Integer | billed duration of call in seconds. |
plan_duration | Integer | number of seconds that was covered by account’s minute plan. |
cli | String | CLI of call after incoming translation rules have been applied. |
cld | String | CLD of call after incoming translation rules have been applied. |
cli_in | String | CLI of call before any translation has been applied. |
cld_in | String | CLD of call before any translation has been applied. |
cost | String | Amount charged from account for the call in base currency of account. |
country | String | Dialed country. |
description | String | Description of dialed destination. |
remote_ip | String | Remote ip address of call originator. |
result | Integer | Call result. |
protocol | String | used protocol (SIP/H.323/IAX2). |
accessibility_cost | Double | cost according to accessibility surcharges configured in Service plan of an account. |
grace_period | Integer | grace period of the call according to the tariff. |
post_call_surcharge | Double | post call surcharge applied to the call according to the tariff. |
connect_fee | Double | connect fee applied to the call according to the tariff. |
free_seconds | Integer | free seconds of the call according to the tariff. |
duration | Double | duration of the call. |
interval_1 | Integer | interval 1 according to the rate of the tariff. |
interval_n | Integer | interval N according to the rate of the tariff. |
price_1 | Double | price 1 according to the rate of the tariff. |
price_n | Double | price N according to the rate of the tariff. |
delay | Double | total delay for the call. |
pdd1xx | Double | duration of time between sending outgoing INVITE and receiving first non-negative reply except 100 Trying (>100, 2xx). |
i_call | Integer | unique i_call value of the call. |
call_id | String | call_id of the call. |
i_cdr | Integer | unique i_cdr value of the call. |
prefix | String | rate prefix used of the call. |
lrn_cld | String | translated LRN CLD of the call. |
lrn_cld_in | String | incoming LRN CLD of the call. |
p_asserted_id | String | p-asserted ID of the call. |
remote_party_id | String | remote party id of the call, rpid. |
release_source | String | release source of the call. |
user_agent | String | user agent of the caller. |
area_name | String | area name of the prefix. |
Call Live
POST /en/api/tel/live/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"i_account_list": [123, 456]
}
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"b2bua_tag" : "",
"cli" : "905399999999",
"i_connection" : 1,
"cld" : "812",
"call_id" : "d84b2a8b-44f79741@1.1.1.1",
"delay" : 2,
"duration" : 0,
"cc_state" : "ARComplete",
"i_account" : 456,
"id" : "978677",
"country" : "TURKEY",
"description": "Pasifik Telekom"
},
{
"b2bua_tag" : "2",
"cli" : "908509999999",
"i_connection" : 1,
"cld" : "123456",
"call_id" : "c80634fb-6f7ad6fd@1.1.1.1",
"delay" : 2,
"duration" : 10,
"cc_state" : "Connected",
"i_account" : 123,
"id" : "687987",
"country" : "TURKEY",
"description": "Pasifik Telekom"
}
]
{
"i_account_list": [123, 456]
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"i_account_list": [123, 456]
}' https://oim.pasifiktelekom.com.tr/en/api/tel/live/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/tel/live/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"i_account_list": [123, 456]
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/tel/live/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"i_account_list\": [123, 456]: 12345}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"i_account_list\": [123, 456]}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/tel/live/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/tel/live/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"i_account_list\": [123, 456]}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/tel/live/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"i_account_list\": [123, 456]}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"i_account_list": [123, 456]
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/tel/live/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get Live calls of your telephones.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/tel/live/
Request Body
This function returns list of calls in any state. Calls are limited to those belonging to the current customer.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
i_account_list | list of integer | - | Yes | it is list of telephone account ID, e.g [123, 456]. |
Response Body
Data types of values in the response.
Paramter | Type |
---|---|
b2bua_tag | string |
cli | string |
i_connection | integer |
cld | string |
call_id | string |
delay | integer |
duration | integer |
cc_state | string |
i_account | integer |
id | string |
country | string |
description | string |
To know call state check the parameter cc_state
it returns call state for 3 status:
"Connected"
means Connected."ARComplete"
means Ringing."WaitRoute"
means Routing.
Call Live Disconnect
POST /en/api/tel/live/disconnect/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"id": 123456
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"result": "OK"
}
{
"id": 123456
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"id": 123456
}' https://oim.pasifiktelekom.com.tr/en/api/tel/live/disconnect/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/tel/live/disconnect/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"id": 123456
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/tel/live/disconnect/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"id\": 123456}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"id\": 123456}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/tel/live/disconnect/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/tel/live/disconnect/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"id\": 123456}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/tel/live/disconnect/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"id\": 123456}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"id": 123456
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/tel/live/disconnect/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Disconnect one live call immediately.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/tel/live/disconnect/
Request Body
This function is used to disconnect an active call.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
id | integer | - | Yes | it is represent current live call ID to disconnect. |
Response Body
- result - OK means that disconnect request was sent successfully
- result - Call not found or not accessible means that disconnect cannot be initiated
PBX
PBX or Virtual Central, this service let you manage your business quality integrated with your CRM, in this case we have 3 main functions:
SIP
- SIP Peers Get sip peers and who is online.
- SIP Extensions Get sip extensions and gateway profiles informations.
CDR
- CDR Report Get a call detail record (CDR) report in your PBX.
- CDR Wav Get your voice records and listen to improve your Help Desk quality.
Live
- Active Call Monitor your system remotely, and focus on important issues.
Before starting pbx functions, we should understanding these variables "central"
, "code"
, and "state"
, illustrated in table:
central | code | state |
---|---|---|
“onapi” | 200 | “PBX OK” |
“onlin” | 412 | “PBX OK (No API)” |
“oflin” | 410 | “PBX Offline” |
“noact” | 423 | “PBX Not Active” |
“noreg” | 404 | “PBX Not Register” |
SIP Peers
POST /en/api/pbx/sippeers/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{}
HTTP/1.1 200 OK
Content-Type: application/json
{
"body": [{
"IPport": "5062",
"Comedia": "yes",
"Status": "OK (119 ms)",
"ChanObjectType": "peer",
"VideoSupport": "no",
"ObjectName": "100",
"RealtimeDevice": "no",
"Dynamic": "yes",
"TextSupport": "no",
"ACL": "yes",
"AutoComedia": "no",
"AutoForcerport": "no",
"Channeltype": "SIP",
"IPaddress": "1.1.1.1",
"Event": "PeerEntry",
"Forcerport": "yes",
"Description": ""
}, {
"IPport": "0",
"Comedia": "yes",
"Status": "UNKNOWN",
"ChanObjectType": "peer",
"VideoSupport": "no",
"ObjectName": "101",
"RealtimeDevice": "no",
"Dynamic": "yes",
"TextSupport": "no",
"ACL": "yes",
"AutoComedia": "no",
"AutoForcerport": "no",
"Channeltype": "SIP",
"IPaddress": "-none-",
"Event": "PeerEntry",
"Forcerport": "yes",
"Description": ""
}, {
"IPport": "5060",
"Comedia": "no",
"Status": "OK (15 ms)",
"ChanObjectType": "peer",
"VideoSupport": "no",
"ObjectName": "908599999999",
"RealtimeDevice": "no",
"Dynamic": "no",
"TextSupport": "no",
"ACL": "no",
"AutoComedia": "no",
"AutoForcerport": "no",
"Channeltype": "SIP",
"IPaddress": "1.1.1.1",
"Event": "PeerEntry",
"Forcerport": "no",
"Description": ""
}],
"state": "PBX OK",
"code": 200,
"central": "onapi"
}
{}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{}' https://oim.pasifiktelekom.com.tr/en/api/pbx/sippeers/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/pbx/sippeers/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/pbx/sippeers/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/pbx/sippeers/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/pbx/sippeers/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/pbx/sippeers/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/pbx/sippeers/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get your sip peers.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/pbx/sippeers/
Request Body
no parameters required.
Response Body
The response body shows defined SIP peers for clients that registered to your PBX server. You can know the following things:
"ObjectName"
: client ID or client phone number."Status"
: you can know it is online e.g. “OK (119 ms)” of offline e.g. “UNKNOWN”."IPaddress"
: the IP address that seems in."IPport"
: the active IP Port.
SIP Extensions
POST /en/api/pbx/sipextensions/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{}
HTTP/1.1 200 OK
Content-Type: application/json
{
"body": {
"908599999999": {
"username": "908599999999",
"context": "from-trunk-sip-908599999999",
"dtmfmode": "rfc2833",
"allow": "alaw",
"insecure": "port,invite",
"secret": "xxxxxxxxxxxxxxxxxxxxxxxxx",
"fromdomain": "sip.pasifiktelekom.com.tr",
"disallow": "all",
"qualify": "yes",
"nat": "auto",
"host": "sip.pasifiktelekom.com.tr",
"fromuser": "908599999999",
"type": "peer"
},
"100": {
"icesupport": "no",
"avpf": "no",
"sendrpid": "no",
"callcounter": "yes",
"callgroup": "",
"port": "5060",
"transport": "udp",
"dial": "SIP/100",
"callerid": "100 <100>",
"encryption": "no",
"secret": "xxxxxxxxxxxxxxxxxxxxxxxxx",
"nat": "yes",
"type": "friend",
"faxdetect": "no",
"mailbox": "100@device",
"qualifyfreq": "60",
"host": "dynamic",
"deny": "0.0.0.0/0.0.0.0",
"dtmfmode": "auto",
"qualify": "yes",
"pickupgroup": "",
"canreinvite": "no",
"context": "from-internal",
"permit": "0.0.0.0/0.0.0.0",
"trustrpid": "yes"
},
"101": {
"icesupport": "no",
"avpf": "no",
"sendrpid": "no",
"callcounter": "yes",
"callgroup": "",
"port": "5060",
"transport": "udp",
"dial": "SIP/101",
"callerid": "101 <101>",
"encryption": "no",
"secret": "xxxxxxxxxxxxxxxxxxxxxxxxx",
"nat": "yes",
"type": "friend",
"faxdetect": "no",
"mailbox": "101@device",
"qualifyfreq": "60",
"host": "dynamic",
"deny": "0.0.0.0/0.0.0.0",
"dtmfmode": "auto",
"qualify": "yes",
"pickupgroup": "",
"canreinvite": "no",
"context": "from-internal",
"permit": "0.0.0.0/0.0.0.0",
"trustrpid": "yes"
}
},
"state": "PBX OK",
"code": 200,
"central": "onapi"
}
{}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{}' https://oim.pasifiktelekom.com.tr/en/api/pbx/sipextensions/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/pbx/sipextensions/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/pbx/sipextensions/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/pbx/sipextensions/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/pbx/sipextensions/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/pbx/sipextensions/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/pbx/sipextensions/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get your sip profiles.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/pbx/sipextensions/
Request Body
no parameters required.
Response Body
The explanations for these extension settings are as follows:
disallow=all − Disables the use of all codecs. Used before specific codecs are enabled in order of preference.
allow=ulaw − Enables a codec based on the μ-law algorithm that is used primarily in North America and Japan. Provides slightly more dynamic range than A-law. This is a 64 kbps PCM (Pulse Code Modulation) codec and a companding variant of the ITU-T G.711 standard. All such codecs impose a minimal load on the CPU.
allow=alaw − Enables a codec based on the A-law algorithm that is used in Europe and the rest of the world. Requires even less CPU processing power than μ-law. In the USA, it is used by convention for international connections if at least one party uses it. Another ITU-T G.711 variant.
allow=gsm − Enables the GSM 06.10 codec, which is the preferred codec for Asterisk. It operates at 13 kbps, employs lossy speech compression, has no licensing requirements and offers excellent CPU-related performance.
qualify=yes − When enabled, SIP NOTIFY messages will periodically be sent to the remote peer to determine both its availability and the latency of its replies.
canreinvite=no − Prevents the two end points from connecting to each other directly, which is normal behavior when using SIP. This forces Asterisk to remain in the transmission path, which is necessary to detect DTMF signals. Some commercial SIP providers also do this.
Provider
Section title. All lines between this section title and the next apply to this section only. This name will be referred to in the dial plan to establish outgoing calls.
type=peer − Definition of the connection type. Type peer is for outgoing connections. Used in cases when the remote host is not expected to place calls (for routing) to this host − only vice versa.
context=incoming − The name specified here, which is arbitrary, will determine where incoming calls will enter the dial plan when they arrive on the channel associated with this section.
host=provider.example.com − Sets the name of the remote host to which this host must connect. In this case the value must be a fully qualified domain name.
username=jsmith − Sets the username with which Asterisk authenticates to a peer, as well as the username for the peer to use when authenticating to Asterisk. This overrides the name in the section title (between the square brackets) that is normally used for this purpose. Also allows registration with a peer before that peer has registered with Asterisk. This option may also be required by other features, such as dialout from voicemail.
fromuser=jsmith − Another method of specifying the username for authentication with a peer to override the name in the section title. With some SIP providers, this option may be required for the channel definition to work.
secret=yourverysecretpassword − Sets the password. Used for authentication together with the name (title) of this section, which in this case is overridden by fromuser=jsmith.
SIP-Phone
Section title. All lines between this section title and the next apply to this section only. This name will be referred to in the dial plan to establish outgoing calls.
type=friend − Definition of the connection type. Type friend is a combination of both user and peer types, since the remote host can connect to this host, as well as vice versa.
context=outgoing − The name specified here, which is arbitrary, will determine where outgoing calls will enter the dial plan when they are made with the phone associated with this section.
host=dynamic − Configures the host to which this host is to connect, although dynamic is used to indicate that the connecting host uses a dynamic IP address.
secret=yourverysecretpassword − Sets the password. Used for authentication together with the name (title) of this section.
CDR Report
POST /en/api/pbx/cdr/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{}
HTTP/1.1 200 OK
Content-Type: application/json
{
"body": [{
"disposition": "NO ANSWER",
"cnum": "05999999999",
"amaflags": "3",
"clid": "\"05999999999\" <05999999999>",
"duration": "15",
"calldate": "2016-11-20 11:33:10",
"dst": "103",
"lastdata": "SIP/103,,trM(auto-blkvm)",
"outbound_cnam": "",
"dstchannel": "SIP/103-000054f2",
"channel": "Local/103@from-queue-00001cb0;2",
"accountcode": "",
"dcontext": "from-internal",
"uniqueid": "1479634390.36435",
"dst_cnam": "",
"src": "05999999999",
"userfield": "",
"did": "",
"lastapp": "Dial",
"cnam": "05999999999",
"outbound_cnum": "",
"billsec": "0",
"recordingfile": ""
}, {
"disposition": "ANSWERED",
"cnum": "05999999999",
"amaflags": "3",
"clid": "\"05999999999\" <05999999999>",
"duration": "85",
"calldate": "2016-11-20 11:32:36",
"dst": "0000",
"lastdata": "0000,t,,,,,,,,",
"outbound_cnam": "",
"dstchannel": "",
"channel": "SIP/902129999999-000054f1",
"accountcode": "",
"dcontext": "ext-queues",
"uniqueid": "1479634356.36433",
"dst_cnam": "",
"src": "05999999999",
"userfield": "",
"did": "902129999999",
"lastapp": "Queue",
"cnam": "05999999999",
"outbound_cnum": "",
"billsec": "85",
"recordingfile": "q-0000-05999999999-20161120-113310-1479634356.36433.wav"
}],
"state": "PBX OK",
"code": 200,
"central": "onapi"
}
{}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{}' https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/pbx/cdr/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get CDR Report.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/
Request Body
All the parameters here optional, no required parameters. in the following table we will describe useful params can be filter the CDR results.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
start_date | string | - | No | Datetime string formated as “%Y-%m-%d %H:%M:%S”, e.g. “2016-09-01 10:12:45” in UTC Timezone. |
end_date | string | - | No | Datetime string formated as “%Y-%m-%d %H:%M:%S”, e.g. “2016-09-01 10:12:45” in UTC Timezone. |
field_name | string | “src” | No | only accept [“src”, “dst”, “channel”, “dstchannel”, “accountcode”], default value “src”. |
field_pattern | string | - | No | only phonenumber as string, e.g “105”, “90850999999”, or “%8509999999” for searching. |
status | string | “ALL” | No | only accept [“ALL”, “ANSWERED”, “BUSY”, “FAILED”, “NO ANSWER”], default value “ALL”. |
recordings | string | “all” | No | only accept [“all”, “only”, “without”], default value “all”. |
Response Body
Name | Value/Example | Description |
---|---|---|
accountcode | 12345 | An account ID. This field is user-defined and is empty by default. |
src | 12565551212 | The calling party’s caller ID number. It is set automatically and is read-only. |
dst | 102 | The destination extension for the call. This field is set automatically and is read-only. |
dcontext | PublicExtensions | The destination context for the call. This field is set automatically and is read-only. |
clid | “Big Bird” <12565551212> | The full caller ID, including the name, of the calling party. This field is set automatically and is read-only. |
channel | SIP/0004F2040808-a1bc23ef | The calling party’s channel. This field is set automatically and is read-only. |
dstchannel | SIP/0004F2046969-9786b0b0 | The called party’s channel. This field is set automatically and is read-only. |
lastapp | Dial | The last dialplan application that was executed. This field is set automatically and is read-only. |
lastdata | SIP/0004F2046969,30,tT | The arguments passed to the lastapp. This field is set automatically and is read-only. |
start | 2010-10-26 12:00:00 | The start time of the call. This field is set automatically and is read-only. |
answer | 2010-10-26 12:00:15 | The answered time of the call. This field is set automatically and is read-only. |
end | 2010-10-26 12:03:15 | The end time of the call. This field is set automatically and is read-only. |
duration | 195 | The number of seconds between the start and end times for the call. This field is set automatically and is read-only. |
billsec | 180 | The number of seconds between the answer and end times for the call. This field is set automatically and is read-only. |
disposition | ANSWERED | An indication of what happened to the call. This may be NO ANSWER, FAILED, BUSY, ANSWERED, or UNKNOWN. |
amaflags | DOCUMENTATION | The Automatic Message Accounting (AMA) flag associated with this call. This may be one of the following: OMIT, BILLING, DOCUMENTATION, or Unknown. |
userfield | PerMinuteCharge:0.02 | A general-purpose user field. This field is empty by default and can be set to a user-defined string.[a] |
uniqueid | 1288112400.1 | The unique ID for the src channel. This field is set automatically and is read-only. |
recordingfile | theuniquename.wav | the wave name file it is unique, this field can be empty. |
[a]
The userfield is not as relevant now as it used to be. Custom CDR variables are a more flexible way to get custom data into CDRs.
CDR Wave
POST /en/api/pbx/cdr/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"wavname": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav",
"calldate": "2016-09-01"
}
HTTP/1.1 200 OK
Content-Type: octet-stream
Content-Disposition: attachment; filename="xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav"
Content-Length: 144545
...
longdata
{
"wavname": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav",
"calldate": "2016-09-01"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"wavname": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav",
"calldate": "2016-10-07"
}' https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/wav/
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"wavname": "xxxx.xxx",
"calldate": "2016-10-07"
}' https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/wav/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/wav/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"wavname": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav",
"calldate": "2016-10-07"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/wav/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"wavname\": \"xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav\", \"calldate\": \"2016-10-07\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"wavname\": \"xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav\", \"calldate\": \"2016-10-07\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/pbx/cdr/wav/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/wav/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"wavname\": \"xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav\", \"calldate\": \"2016-10-07\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/wav/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"wavname\": \"xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav\", \"calldate\": \"2016-10-07\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"wavname": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav",
"calldate": "2016-10-07"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/wav/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Download CDR wav file.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/pbx/cdr/wav/
Request Body
All parameters are required. and in string format.
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
wavname | string | - | Yes | this field in basename only without directory "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.wav" , e.g. "out-05355620760-101-20151208-102449-1449563089.106.wav" . |
calldate | string | - | Yes | Date string formated as “%Y-%m-%d”, e.g. “2016-09-01”. |
Note "wavname"
For custom search available by “uniqueid”, “src” and “dst” e.g "102449-1449563089.106"
. related file name accept regular expression like grep
in shellscrip, it returns one wav file only.
Response Body
The response will be definitly one wav file.
Active Call
POST /en/api/pbx/activecall/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{}
HTTP/1.1 200 OK
Content-Type: application/json
{
"body": [{
"Channel": "SIP\/100-0000112f",
"Context": "macro-dial-one",
"Extension": "s",
"Prio": "1",
"State": "Up",
"Application": "AppDial",
"Data": "(Outgoing Line)",
"CallerID": "100",
"Duration": "00:08:57",
"Accountcode": "",
"PeerAccount": "",
"BridgedTo": "Local\/200"
}, {
"Channel": "SIP\/902429999999-000",
"Context": "ext-queues",
"Extension": "0001",
"Prio": "40",
"State": "Up",
"Application": "Queue",
"Data": "0001,t,,,,,,,,",
"CallerID": "02129999999",
"Duration": "00:09:11",
"Accountcode": "",
"PeerAccount": "",
"BridgedTo": "Local\/200"
}, {
"Channel": "Local\/100@from-queu",
"Context": "from-queue",
"Extension": "0001",
"Prio": "1",
"State": "Up",
"Application": "AppQueue",
"Data": "(Outgoing Line)",
"CallerID": "100",
"Duration": "00:08:57",
"Accountcode": "",
"PeerAccount": "",
"BridgedTo": "SIP\/90242"
}, {
"Channel": "Local\/100@from-queu",
"Context": "macro-dial-one",
"Extension": "s",
"Prio": "43",
"State": "Up",
"Application": "Dial",
"Data": "SIP\/100,,trM(auto-blkvm)",
"CallerID": "02129999999",
"Duration": "00:08:57",
"Accountcode": "",
"PeerAccount": "",
"BridgedTo": "SIP\/100-"
},
"0 active channels",
"0 active calls",
"26612 calls processed"
],
"state": "PBX OK",
"code": 200,
"central": "onapi"
}
{}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{}' https://oim.pasifiktelekom.com.tr/en/api/pbx/activecall/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/pbx/activecall/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/pbx/activecall/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/pbx/activecall/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/pbx/activecall/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/pbx/activecall/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/pbx/activecall/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get current active call.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/pbx/activecall/
Request Body
no parameters required.
Response Body
the active call will be based on important response parameter.
Name | Description |
---|---|
Channel | source call channel. |
State | it is contains [“Up”, “Ring”, “Ringing”, “Down”]. |
Application | it is contains [“Dial”, “AppDial”, “AppQueue”, “Queue”]. |
CallerID | it is value the phonenumber that comming from outside, not defined in pbx peers. |
Duration | it is the duration time of call “hh:mm:ss” e.g "00:03:23" 3 minutes and 23 seconds. |
BridgedTo | it is the foreign key of "Channel" , it describes the related chain between two Channels. |
Fax
You can use our service to send and receive fax, it made easy and very simple.
Submit Fax
- Submit send one Fax to many receipients.
Query Fax
- Query get fax report by ID.
- Query Report get fax report by datetime range (start_date, end_date).
- Query Inbox get fax inbox by datetime range (start_date, end_date).
File Manager
- Download File Download file by filename.
- Upload File Upload file by filename.
Submit - Fax
POST /en/api/fax/submit/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"from":"90212XXXXXXX",
"to":"902169999999,902169999998",
"filename":"72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "123456",
"code": 200,
"description": "OK"
}
{
"from":"90212XXXXXXX",
"to":"902169999999,902169999998",
"filename":"72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"from":"90212XXXXXXX",
"to":"902169999999,902169999998",
"filename":"72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc"
}' https://oim.pasifiktelekom.com.tr/en/api/fax/submit/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/fax/submit/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"from":"90212XXXXXXX",
"to":"902169999999,902169999998",
"filename":"72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/fax/submit/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"from\":\"90212XXXXXXX\",\"to\":\"902169999999,902169999998\",\"filename\":\"72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"from\":\"90212XXXXXXX\",\"to\":\"902169999999,902169999998\",\"filename\":\"72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/fax/submit/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/fax/submit/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"from\":\"90212XXXXXXX\",\"to\":\"902169999999,902169999998\",\"filename\":\"72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/fax/submit/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"from\":\"90212XXXXXXX\", \"to\":\"902169999999,902169999998\",\"filename\":\"72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"from": "90212XXXXXXX",
"to": "902169999999,902169999998",
"filename": "72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/fax/submit/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Before you getting started with submit function you need to upload file to server, and you should understand file upload/download for fax, for one file you could send it to many receipients.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/fax/submit/
Request Body
as like Submit for SMS, we have in the following table:
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
from | string | - | Yes | "90212XXXXXXX" it is cli fax number, based on your given fax number. |
to | string | - | Yes | "902169999999" your destination phone number, it could be multiple and seperated by , e.g. “902169999999,902169999998”. |
filename | string | - | Yes | "72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc" it is uploaded document file name. |
is_enhanced | boolean | false | No | true means “resize to 1728x2255, set density to 204x196 TIFF” that is compatible with modern fax machines, false means “resize to 1728x1078, set density 204x98 TIFF” that is compatible with modern and old fax machines. |
scheduled_delivery_time | string | currentDatetime |
No | Fax scheduling Datetime "%Y-%m-%dT%H:%M:%SZ" // e.g "2016-07-23T21:54:02Z" in UTC Timezone . |
period | integer | 1440 | No | The maximum validity period is 24 hours (1440 minutes). |
Response Body
the response will be "id"
as positive integer value or -1
for fault.
Query - Fax
POST /en/api/fax/query/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"fax_id": "123456"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"count": 1,
"delivered": 1,
"sender": "90212XXXXXXX",
"succeeded": true,
"created": "28.10.2016 - 18:29",
"fax_filename": "72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc",
"undelivered": 0,
"waiting": 0,
"cost": 1.0,
"is_scheduled": false,
"fax_id": 123456,
"scheduled_datetime": "28.10.2016 - 17:24"
}
{
"fax_id": "123456"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"fax_id": "123456"
}' https://oim.pasifiktelekom.com.tr/en/api/fax/query/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/fax/query/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"fax_id": "123456"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/fax/query/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"fax_id\": \"123456\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"fax_id\": \"123456\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/fax/query/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/fax/query/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"fax_id\": \"123456\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/fax/query/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"fax_id\": \"123456\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"fax_id": "123456"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/fax/query/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get query of fax report by ID.
HTTP Request
POST https://oim.pasifiktelekom.com.tr/en/api/fax/query/
Request Body
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
fax_id | string/integer | - | Yes | it is unique id of submit fax response e.g. “123456”. |
Response Body
Name | Type |
---|---|
count | integer |
delivered | integer |
sender | string |
succeeded | boolean |
created | string |
fax_filename | string |
undelivered | integer |
waiting | integer |
cost | double |
is_scheduled | boolean |
fax_id | integer |
scheduled_datetime | string |
Query Report - Fax
POST /en/api/fax/query/report/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}
HTTP/1.1 200 OK
Content-Type: application/json
[{
"count": 3,
"delivered": 3,
"sender": "90212XXXXXXX",
"succeeded": true,
"created": "02.03.2016 - 16:05",
"fax_filename": "2c18ba26-2167-4eb3-8541-3439ba33ed72.jpg",
"undelivered": 0,
"waiting": 0,
"cost": 1.0,
"is_scheduled": false,
"fax_id": 123,
"scheduled_datetime": "25.10.2016 - 16:04"
}, {
"count": 1,
"delivered": 1,
"sender": "90212XXXXXXX",
"succeeded": true,
"created": "13.03.2016 - 11:27",
"fax_filename": "fe57d180-8c14-4d77-b9b3-8d7b690bb002.jpg",
"undelivered": 0,
"waiting": 0,
"cost": 1.0,
"is_scheduled": false,
"fax_id": 456,
"scheduled_datetime": "25.10.2016 - 11:26"
}]
{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}' https://oim.pasifiktelekom.com.tr/en/api/fax/query/report/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/fax/query/report/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/fax/query/report/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/fax/query/report/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/fax/query/report/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/fax/query/report/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"start_date": "01.03.2016",
"end_date": "14.03.2016"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/fax/query/report/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get query of fax report using datetime range.
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/fax/query/report/
Request Body
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
start_date | string | - | Yes | Date string format formated as turkish date time format “%d.%m.%Y” e.g. “01.03.2016”. |
end_date | string | - | Yes | Date string format formated as turkish date time format “%d.%m.%Y” e.g. “14.03.2016”. |
Response Body
The response will be as list of dictionary, it is the same response body in Query Fax.
Query Inbox - Fax
POST /en/api/fax/query/inbox/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}
HTTP/1.1 200 OK
Content-Type: application/json
[{
"cli": "902169999999",
"cld": "90212XXXXXXX",
"is_mailed": false,
"datetime": "05.03.2016 - 22:02",
"fax_id": 123,
"fax_filename": "rxfax-455f7442-9e0a-11e6-9d83-f5cc302373e2.tiff"
}, {
"cli": "902129999998",
"cld": "90212XXXXXXX",
"is_mailed": false,
"datetime": "07.03.2016 - 22:01",
"fax_id": 456,
"fax_filename": "rxfax-133f1b66-9e0a-11e6-9d7b-f5cc302373e2.tiff"
}]
{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}' https://oim.pasifiktelekom.com.tr/en/api/fax/query/inbox/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/fax/query/inbox/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"start_date": "01.03.2016",
"end_date": "14.03.2016"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/fax/query/inbox/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/fax/query/inbox/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/fax/query/inbox/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/fax/query/inbox/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"start_date\": \"01.03.2016\", \"end_date\": \"14.03.2016\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"start_date": "01.03.2016",
"end_date": "14.03.2016"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/fax/query/inbox/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Get query of fax inbox (incoming/received fax).
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/fax/query/inbox/
Request Body
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
start_date | string | - | Yes | Date string format formated as turkish date time format “%d.%m.%Y” e.g. “01.03.2016”. |
end_date | string | - | Yes | Date string format formated as turkish date time format “%d.%m.%Y” e.g. “14.03.2016”. |
Response Body
Name | Type |
---|---|
cli | string |
cld | string |
is_mailed | boolean |
datetime | string |
fax_id | integer |
fax_filename | string |
Download File - Fax
POST /en/api/fax/download/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json
Accept: application/json
{
"from": "90212XXXXXXX",
"filename": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg",
"format": "pdf",
"directory": "txfax"
}
HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Disposition: attachment; filename="xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.pdf"
...
longdata
{
"from": "90212XXXXXXX",
"filename": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg",
"format": "pdf",
"directory": "txfax"
}
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"from": "90212XXXXXXX",
"filename": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg",
"format": "pdf",
"directory": "txfax"
}' https://oim.pasifiktelekom.com.tr/en/api/fax/download/
curl -X POST
-H 'Content-Type: application/json'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-d '{
"from": "90212XXXXXXX",
"filename": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.tiff",
"format": "tiff",
"directory": "rxfax"
}' https://oim.pasifiktelekom.com.tr/en/api/fax/download/
<?php
$request = new HttpRequest();
$request->setUrl('https://oim.pasifiktelekom.com.tr/en/api/fax/download/');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'accept' => 'application/json',
'content-type' => 'application/json',
'authorization' => 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
));
$request->setBody('{
"from": "90212XXXXXXX",
"filename": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg",
"format": "pdf",
"directory": "txfax"
}');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
require 'uri'
require 'net/http'
url = URI("https://oim.pasifiktelekom.com.tr/en/api/fax/download/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
request = Net::HTTP::Post.new(url)
request["authorization"] = 'QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
request["content-type"] = 'application/json'
request["accept"] = 'application/json'
request.body = "{\"from\": \"90212XXXXXXX\", \"filename\": \"xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg\", \"format\": \"pdf\", \"directory\": \"txfax\"}"
response = http.request(request)
puts response.read_body
import http.client
conn = http.client.HTTPSConnection("oim.pasifiktelekom.com.tr")
payload = "{\"from\": \"90212XXXXXXX\", \"filename\": \"xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg\", \"format\": \"pdf\", \"directory\": \"txfax\"}"
headers = {
'authorization': "QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
'content-type': "application/json",
'accept': "application/json"
}
conn.request("POST", "/en/api/fax/download/", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
HttpResponse<String> response = Unirest.post("https://oim.pasifiktelekom.com.tr/en/api/fax/download/")
.header("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
.header("content-type", "application/json")
.header("accept", "application/json")
.body("{\"from\": \"90212XXXXXXX\", \"filename\": \"xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg\", \"format\": \"pdf\", \"directory\": \"txfax\"}")
.asString();
var client = new RestClient("https://oim.pasifiktelekom.com.tr/en/api/fax/download/");
var request = new RestRequest(Method.POST);
request.AddHeader("accept", "application/json");
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{\"from\": \"90212XXXXXXX\", \"filename\": \"xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg\", \"format\": \"pdf\", \"directory\": \"txfax\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
var data = JSON.stringify({
"from": "90212XXXXXXX",
"filename": "xxx-xxxxxx-xxx-xxxxx-xxxx.xxx.jpg",
"format": "pdf",
"directory": "txfax"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = false;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://oim.pasifiktelekom.com.tr/en/api/fax/download/");
xhr.setRequestHeader("authorization", "QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
Download file that you send or received as fax by filename.
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/fax/download/
Request Body
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
from | string | - | Yes | “90212XXXXXXX” it is cli fax number, based on your given fax number. |
filename | string | - | Yes | “72df3bef-ec07-4968-9959-bd6a70a2e8c8.doc” it is uploaded document file name. |
format | string | - | Yes | it is based on file converted format [“tiff”, “pdf”], sometimes the *.doc or other format you send does not available or was deleted permanently. |
is_enhanced | boolean | false | No | true means “resize to 1728x2255, set density to 204x196 TIFF” that is compatible with modern fax machines, false means “resize to 1728x1078, set density 204x98 TIFF” that is compatible with modern and old fax machines. |
directory | string | “txfax” | directory has “rxfax” for fax inbox, “txfax” for fax report. |
Response Body
The response will be definitly one pdf/tiff file.
Upload File - Fax
POST /en/api/fax/upload/ HTTP/1.1
Host: oim.pasifiktelekom.com.tr
Authorization: QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: image/gif, image/jpeg, */*
Content-Length: 35432
Accept: application/json
filename=@/full/path/to/mydocumentfile.jpg;type=image/jpg
HTTP/1.1 200 OK
Content-Type: application/json
{
"filename": "72df3bef-ec07-4968-9959-bd6a70a2e5e1.jpg",
"message": "OK",
"code": 200
}
curl -X POST
-H 'Content-Type: image/jpg'
-H 'Accept: application/json'
-H 'Authorization:QWxhZGRpbjpvcGVuIHNlc2FtZQ=='
-F "filename=@/full/path/to/mydocumentfile.jpg;type=image/jpg"
https://oim.pasifiktelekom.com.tr/en/api/fax/upload/
Upload file that you need to send as fax by filename.
Http Request
POST https://oim.pasifiktelekom.com.tr/en/api/fax/upload/
Request Body
Parameter | Type | Default | Required | Description |
---|---|---|---|---|
filename | string/mediatype | - | Yes | “mydocumentfile.jpg” it is uploaded document file name. |
Notice: This service accept only multipart/form-data
.
Response Body
the response will be contain application/json
data type contains:
Name | Type |
---|---|
filename | string |
code | integer |
message | string |
Errors
The Pasifik API uses the following error codes:
Error Code | Meaning |
---|---|
400 | Bad Request – Your request sucks |
401 | Unauthorized – Your API key is wrong |
403 | Forbidden – The kitten requested is hidden for administrators only |
404 | Not Found – The specified kitten could not be found |
405 | Method Not Allowed – You tried to access a kitten with an invalid method |
406 | Not Acceptable – You requested a format that isn’t json |
410 | Gone – The kitten requested has been removed from our servers |
418 | I’m a teapot |
429 | Too Many Requests – You’re requesting too many kittens! Slow down! |
500 | Internal Server Error – We had a problem with our server. Try again later. |
503 | Service Unavailable – We’re temporarially offline for maintanance. Please try again later. |