Scheduling API
With Scheduling API, you can schedule DB, PA or CD transaction in the future.
NOTE: You should be fully PCI compliant if you wish to perform tokenization requests server-to-server (as it requires that you collect the card data).
How it works
Store the Payment Data
Register the customer payment information.
Schedule a payment
Send a schedule request on top of the registration
We execute the transaction for you
Payment transaction committed on time.
Cancel the schedule
Merchant cancels the scheduled transaction.
1. Store the payment data
Register the customer payment information could be done from COPYandPAY or could be done through Server-To-Server in two methods: Store the data during a payment or store it as stand alone.
Following is an example of stand alone registration.
curl https://test.como.world/v1/registrations \ -d "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" \ -d "paymentBrand=VISA" \ -d "card.number=4200000000000000" \ -d "card.holder=Jane Jones" \ -d "card.expiryMonth=05" \ -d "card.expiryYear=2022" \ -d "card.cvv=123" \ -H "Authorization: Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="
public Dictionary<string, dynamic> Request() { Dictionary<string, dynamic> responseData; string data="entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "&paymentBrand=VISA" + "&card.number=4200000000000000" + "&card.holder=Jane Jones" + "&card.expiryMonth=05" + "&card.expiryYear=2022" + "&card.cvv=123"; string url = "https://test.como.world/v1/registrations"; byte[] buffer = Encoding.ASCII.GetBytes(data); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = "POST"; request.Headers["Authorization"] = "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="; request.ContentType = "application/x-www-form-urlencoded"; Stream PostData = request.GetRequestStream(); PostData.Write(buffer, 0, buffer.Length); PostData.Close(); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { Stream dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); var s = new JavaScriptSerializer(); responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd()); reader.Close(); dataStream.Close(); } return responseData; } responseData = Request()["result"]["description"];
import groovy.json.JsonSlurper public static String request() { def data = "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "&paymentBrand=VISA" + "&card.number=4200000000000000" + "&card.holder=Jane Jones" + "&card.expiryMonth=05" + "&card.expiryYear=2022" + "&card.cvv=123" def url = "https://test.como.world/v1/registrations".toURL() def connection = url.openConnection() connection.setRequestMethod("POST") connection.setRequestProperty("Authorization","Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") connection.doOutput = true connection.outputStream << data def json = new JsonSlurper().parseText(connection.inputStream.text) json } println request()
private String request() throws IOException { URL url = new URL("https://test.como.world/v1/registrations"); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="); conn.setDoInput(true); conn.setDoOutput(true); String data = "" + "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "&paymentBrand=VISA" + "&card.number=4200000000000000" + "&card.holder=Jane Jones" + "&card.expiryMonth=05" + "&card.expiryYear=2022" + "&card.cvv=123"; DataOutputStream wr = new DataOutputStream(conn.getOutputStream()); wr.writeBytes(data); wr.flush(); wr.close(); int responseCode = conn.getResponseCode(); InputStream is; if (responseCode >= 400) is = conn.getErrorStream(); else is = conn.getInputStream(); return IOUtils.toString(is); }
const https = require('https'); const querystring = require('querystring'); const request = async () => { const path='/v1/registrations'; const data = querystring.stringify({ 'entityId':'8ac7a4c7761cdc4a01761f34e79b09a1', 'paymentBrand':'VISA', 'card.number':'4200000000000000', 'card.holder':'Jane Jones', 'card.expiryMonth':'05', 'card.expiryYear':'2022', 'card.cvv':'123' }); const options = { port: 443, host: 'test.como.world', path: path, method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': data.length, 'Authorization':'Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==' } }; return new Promise((resolve, reject) => { const postRequest = https.request(options, function(res) { const buf = []; res.on('data', chunk => { buf.push(Buffer.from(chunk)); }); res.on('end', () => { const jsonString = Buffer.concat(buf).toString('utf8'); try { resolve(JSON.parse(jsonString)); } catch (error) { reject(error); } }); }); postRequest.on('error', reject); postRequest.write(data); postRequest.end(); }); }; request().then(console.log).catch(console.error);
function request() { $url = "https://test.como.world/v1/registrations"; $data = "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" . "&paymentBrand=VISA" . "&card.number=4200000000000000" . "&card.holder=Jane Jones" . "&card.expiryMonth=05" . "&card.expiryYear=2022" . "&card.cvv=123"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization:Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==')); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $responseData = curl_exec($ch); if(curl_errno($ch)) { return curl_error($ch); } curl_close($ch); return $responseData; } $responseData = request();
try: from urllib.parse import urlencode from urllib.request import build_opener, Request, HTTPHandler from urllib.error import HTTPError, URLError except ImportError: from urllib import urlencode from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError import json def request(): url = "https://test.como.world/v1/registrations" data = { 'entityId' : '8ac7a4c7761cdc4a01761f34e79b09a1', 'paymentBrand' : 'VISA', 'card.number' : '4200000000000000', 'card.holder' : 'Jane Jones', 'card.expiryMonth' : '05', 'card.expiryYear' : '2022', 'card.cvv' : '123' } try: opener = build_opener(HTTPHandler) request = Request(url, data=urlencode(data).encode('utf-8')) request.add_header('Authorization', 'Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==') request.get_method = lambda: 'POST' response = opener.open(request) return json.loads(response.read()); except HTTPError as e: return json.loads(e.read()); except URLError as e: return e.reason; responseData = request(); print(responseData);
require 'net/https' require 'uri' require 'json' def request() uri = URI('https://test.como.world/v1/registrations') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true req = Net::HTTP::Post.new(uri.path) req.set_form_data({ 'entityId' => '8ac7a4c7761cdc4a01761f34e79b09a1', 'paymentBrand' => 'VISA', 'card.number' => '4200000000000000', 'card.holder' => 'Jane Jones', 'card.expiryMonth' => '05', 'card.expiryYear' => '2022', 'card.cvv' => '123' }) res = http.request(req) return JSON.parse(res.body) end puts request()
def initialPayment : String = { val url = "https://test.como.world/v1/registrations" val data = ("" + "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "&paymentBrand=VISA" + "&card.number=4200000000000000" + "&card.holder=Jane Jones" + "&card.expiryMonth=05" + "&card.expiryYear=2022" + "&card.cvv=123" ) val conn = new URL(url).openConnection() conn match { case secureConn: HttpsURLConnection => secureConn.setRequestMethod("POST") case _ => throw new ClassCastException } conn.setDoInput(true) conn.setDoOutput(true) IOUtils.write(data, conn.getOutputStream()) conn.setRequestProperty("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") conn.connect() if (conn.getResponseCode() >= 400) { return IOUtils.toString(conn.getErrorStream()) } else { return IOUtils.toString(conn.getInputStream()) } }
Public Function Request() As Dictionary(Of String, Object) Dim url As String = "https://test.como.world/v1/registrations" Dim data As String = "" + "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "&paymentBrand=VISA" + "&card.number=4200000000000000" + "&card.holder=Jane Jones" + "&card.expiryMonth=05" + "&card.expiryYear=2022" + "&card.cvv=123" Dim req As WebRequest = WebRequest.Create(url) req.Method = "POST" req.Headers.Add("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") req.ContentType = "application/x-www-form-urlencoded" Dim byteArray As Byte() = Encoding.UTF8.GetBytes(data) req.ContentLength = byteArray.Length Dim dataStream As Stream = req.GetRequestStream() dataStream.Write(byteArray, 0, byteArray.Length) dataStream.Close() Dim res As WebResponse = req.GetResponse() Dim resStream = res.GetResponseStream() Dim reader As New StreamReader(resStream) Dim response As String = reader.ReadToEnd() reader.Close() resStream.Close() res.Close() Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer() Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response) Return dict End Function responseData = Request()("result")("description")
Authorization | Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg== |
entityId=8ac7a4c7761cdc4a01761f34e79b09a1
paymentBrand=VISA
card.number=4200000000000000
card.holder=Jane Jones
card.expiryMonth=05
card.expiryYear=2022
card.cvv=123
2. Schedule a payment
Send a request to /schedules end point with the registrationId, payment type and the job schedule which describes when and how often the transaction should be committed.
For complete reference of job parameters, check API Parameters Reference:
curl https://test.como.world/scheduling/v1/schedules \ -d "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" \ -d "registrationId={registrationId}" \ -d "amount=17.00" \ -d "currency=EUR" \ -d "paymentType=DB" \ -d "job.month=*" \ -d "job.dayOfMonth=1" \ -H "Authorization: Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="
public Dictionary<string, dynamic> Request() { Dictionary<string, dynamic> responseData; string data="entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "®istrationId={registrationId}" + "&amount=17.00" + "¤cy=EUR" + "&paymentType=DB" + "&job.month=*" + "&job.dayOfMonth=1"; string url = "https://test.como.world/scheduling/v1/schedules"; byte[] buffer = Encoding.ASCII.GetBytes(data); HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = "POST"; request.Headers["Authorization"] = "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="; request.ContentType = "application/x-www-form-urlencoded"; Stream PostData = request.GetRequestStream(); PostData.Write(buffer, 0, buffer.Length); PostData.Close(); using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { Stream dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); var s = new JavaScriptSerializer(); responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd()); reader.Close(); dataStream.Close(); } return responseData; } responseData = Request()["result"]["description"];
import groovy.json.JsonSlurper public static String request() { def data = "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "®istrationId={registrationId}" + "&amount=17.00" + "¤cy=EUR" + "&paymentType=DB" + "&job.month=*" + "&job.dayOfMonth=1" def url = "https://test.como.world/scheduling/v1/schedules".toURL() def connection = url.openConnection() connection.setRequestMethod("POST") connection.setRequestProperty("Authorization","Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") connection.doOutput = true connection.outputStream << data def json = new JsonSlurper().parseText(connection.inputStream.text) json } println request()
private String request() throws IOException { URL url = new URL("https://test.como.world/scheduling/v1/schedules"); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="); conn.setDoInput(true); conn.setDoOutput(true); String data = "" + "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "®istrationId={registrationId}" + "&amount=17.00" + "¤cy=EUR" + "&paymentType=DB" + "&job.month=*" + "&job.dayOfMonth=1"; DataOutputStream wr = new DataOutputStream(conn.getOutputStream()); wr.writeBytes(data); wr.flush(); wr.close(); int responseCode = conn.getResponseCode(); InputStream is; if (responseCode >= 400) is = conn.getErrorStream(); else is = conn.getInputStream(); return IOUtils.toString(is); }
const https = require('https'); const querystring = require('querystring'); const request = async () => { const path='/scheduling/v1/schedules'; const data = querystring.stringify({ 'entityId':'8ac7a4c7761cdc4a01761f34e79b09a1', 'registrationId':'{registrationId}', 'amount':'17.00', 'currency':'EUR', 'paymentType':'DB', 'job.month':'*', 'job.dayOfMonth':'1' }); const options = { port: 443, host: 'test.como.world', path: path, method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': data.length, 'Authorization':'Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==' } }; return new Promise((resolve, reject) => { const postRequest = https.request(options, function(res) { const buf = []; res.on('data', chunk => { buf.push(Buffer.from(chunk)); }); res.on('end', () => { const jsonString = Buffer.concat(buf).toString('utf8'); try { resolve(JSON.parse(jsonString)); } catch (error) { reject(error); } }); }); postRequest.on('error', reject); postRequest.write(data); postRequest.end(); }); }; request().then(console.log).catch(console.error);
function request() { $url = "https://test.como.world/scheduling/v1/schedules"; $data = "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" . "®istrationId={registrationId}" . "&amount=17.00" . "¤cy=EUR" . "&paymentType=DB" . "&job.month=*" . "&job.dayOfMonth=1"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization:Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==')); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $responseData = curl_exec($ch); if(curl_errno($ch)) { return curl_error($ch); } curl_close($ch); return $responseData; } $responseData = request();
try: from urllib.parse import urlencode from urllib.request import build_opener, Request, HTTPHandler from urllib.error import HTTPError, URLError except ImportError: from urllib import urlencode from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError import json def request(): url = "https://test.como.world/scheduling/v1/schedules" data = { 'entityId' : '8ac7a4c7761cdc4a01761f34e79b09a1', 'registrationId' : '{registrationId}', 'amount' : '17.00', 'currency' : 'EUR', 'paymentType' : 'DB', 'job.month' : '*', 'job.dayOfMonth' : '1' } try: opener = build_opener(HTTPHandler) request = Request(url, data=urlencode(data).encode('utf-8')) request.add_header('Authorization', 'Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==') request.get_method = lambda: 'POST' response = opener.open(request) return json.loads(response.read()); except HTTPError as e: return json.loads(e.read()); except URLError as e: return e.reason; responseData = request(); print(responseData);
require 'net/https' require 'uri' require 'json' def request() uri = URI('https://test.como.world/scheduling/v1/schedules') http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true req = Net::HTTP::Post.new(uri.path) req.set_form_data({ 'entityId' => '8ac7a4c7761cdc4a01761f34e79b09a1', 'registrationId' => '{registrationId}', 'amount' => '17.00', 'currency' => 'EUR', 'paymentType' => 'DB', 'job.month' => '*', 'job.dayOfMonth' => '1' }) res = http.request(req) return JSON.parse(res.body) end puts request()
def initialPayment : String = { val url = "https://test.como.world/scheduling/v1/schedules" val data = ("" + "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "®istrationId={registrationId}" + "&amount=17.00" + "¤cy=EUR" + "&paymentType=DB" + "&job.month=*" + "&job.dayOfMonth=1" ) val conn = new URL(url).openConnection() conn match { case secureConn: HttpsURLConnection => secureConn.setRequestMethod("POST") case _ => throw new ClassCastException } conn.setDoInput(true) conn.setDoOutput(true) IOUtils.write(data, conn.getOutputStream()) conn.setRequestProperty("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") conn.connect() if (conn.getResponseCode() >= 400) { return IOUtils.toString(conn.getErrorStream()) } else { return IOUtils.toString(conn.getInputStream()) } }
Public Function Request() As Dictionary(Of String, Object) Dim url As String = "https://test.como.world/scheduling/v1/schedules" Dim data As String = "" + "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" + "®istrationId={registrationId}" + "&amount=17.00" + "¤cy=EUR" + "&paymentType=DB" + "&job.month=*" + "&job.dayOfMonth=1" Dim req As WebRequest = WebRequest.Create(url) req.Method = "POST" req.Headers.Add("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") req.ContentType = "application/x-www-form-urlencoded" Dim byteArray As Byte() = Encoding.UTF8.GetBytes(data) req.ContentLength = byteArray.Length Dim dataStream As Stream = req.GetRequestStream() dataStream.Write(byteArray, 0, byteArray.Length) dataStream.Close() Dim res As WebResponse = req.GetResponse() Dim resStream = res.GetResponseStream() Dim reader As New StreamReader(resStream) Dim response As String = reader.ReadToEnd() reader.Close() resStream.Close() res.Close() Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer() Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response) Return dict End Function responseData = Request()("result")("description")
Authorization | Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg== |
entityId=8ac7a4c7761cdc4a01761f34e79b09a1
registrationId={registrationId}
amount=17.00
currency=EUR
paymentType=DB
job.month=*
job.dayOfMonth=1
3. We execute the transaction for you
As the scheduled transaction triggers, the system commits the payment transaction on time using the stored payment information and payment type specified.
The system will commit a payment transaction with the paymentType, amount and currency specified, and will use the payment information registered on the first step.
4. Cancel the schedule
As the case of canceling the scheduled transaction, merchant sends a deschedule request to cancel future transactions.
Send a request to the de-scheduling specifying the referenceId of the scheduled transaction as following:
https://test.como.world/scheduling/v1/schedules/
curl -X DELETE "https://test.como.world/scheduling/v1/schedules/{id}\ ?entityId=8ac7a4c7761cdc4a01761f34e79b09a1" \ -H "Authorization: Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="
https://test.como.world/scheduling/v1/schedules/
public Dictionary<string, dynamic> Request() { Dictionary<string, dynamic> responseData; string data="entityId=8ac7a4c7761cdc4a01761f34e79b09a1"; string url = "https://test.como.world/scheduling/v1/schedules/{id}?" + data; HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = "DELETE"; request.Headers["Authorization"] = "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="; using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { Stream dataStream = response.GetResponseStream(); StreamReader reader = new StreamReader(dataStream); var s = new JavaScriptSerializer(); responseData = s.Deserialize<Dictionary<string, dynamic>>(reader.ReadToEnd()); reader.Close(); dataStream.Close(); } return responseData; } responseData = Request()["result"]["description"];
https://test.como.world/scheduling/v1/schedules/
import groovy.json.JsonSlurper public static String request() { def data = "entityId=8ac7a4c7761cdc4a01761f34e79b09a1" def url = ("https://test.como.world/scheduling/v1/schedules/{id}?" + data).toURL() def connection = url.openConnection() connection.setRequestMethod("DELETE") connection.setRequestProperty("Authorization","Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") def json = new JsonSlurper().parseText(connection.inputStream.text) json } println request()
https://test.como.world/scheduling/v1/schedules/
private String request() throws IOException { URL url = new URL("https://test.como.world/scheduling/v1/schedules/{id} "&entityId=8ac7a4c7761cdc4a01761f34e79b09a1"); HttpsURLConnection conn = (HttpsURLConnection) url.openConnection(); conn.setRequestMethod("DELETE"); conn.setRequestProperty("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg=="); int responseCode = conn.getResponseCode(); InputStream is; if (responseCode >= 400) is = conn.getErrorStream(); else is = conn.getInputStream(); return IOUtils.toString(is); }
https://test.como.world/scheduling/v1/schedules/
const https = require('https'); const querystring = require('querystring'); const request = async () => { var path='/scheduling/v1/schedules/{id}'; path += '?entityId=8ac7a4c7761cdc4a01761f34e79b09a1'; const options = { port: 443, host: 'test.como.world', path: path, method: 'DELETE', headers: { 'Authorization':'Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==' } }; return new Promise((resolve, reject) => { const postRequest = https.request(options, function(res) { const buf = []; res.on('data', chunk => { buf.push(Buffer.from(chunk)); }); res.on('end', () => { const jsonString = Buffer.concat(buf).toString('utf8'); try { resolve(JSON.parse(jsonString)); } catch (error) { reject(error); } }); }); postRequest.on('error', reject); postRequest.end(); }); }; request().then(console.log).catch(console.error);
https://test.como.world/scheduling/v1/schedules/
function request() { $url = "https://test.como.world/scheduling/v1/schedules/{id}"; $url .= "?entityId=8ac7a4c7761cdc4a01761f34e79b09a1"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization:Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==')); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);// this should be set to true in production curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $responseData = curl_exec($ch); if(curl_errno($ch)) { return curl_error($ch); } curl_close($ch); return $responseData; } $responseData = request();
https://test.como.world/scheduling/v1/schedules/
try: from urllib.parse import urlencode from urllib.request import build_opener, Request, HTTPHandler from urllib.error import HTTPError, URLError except ImportError: from urllib import urlencode from urllib2 import build_opener, Request, HTTPHandler, HTTPError, URLError import json def request(): url = "https://test.como.world/scheduling/v1/schedules/{id}" url += '?entityId=8ac7a4c7761cdc4a01761f34e79b09a1' try: opener = build_opener(HTTPHandler) request = Request(url, data=b'') request.add_header('Authorization', 'Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==') request.get_method = lambda: 'DELETE' response = opener.open(request) return json.loads(response.read()); except HTTPError as e: return json.loads(e.read()); except URLError as e: return e.reason; responseData = request(); print(responseData);
https://test.como.world/scheduling/v1/schedules/
require 'net/https' require 'uri' require 'json' def request() path = ("?entityId=8ac7a4c7761cdc4a01761f34e79b09a1") uri = URI.parse('https://test.como.world/scheduling/v1/schedules/{id}' + path) http = Net::HTTP.new(uri.host, uri.port) http.use_ssl = true res = http.delete(uri.request_uri) return JSON.parse(res.body) end puts request()
https://test.como.world/scheduling/v1/schedules/
def initialPayment : String = { val url = "https://test.como.world/scheduling/v1/schedules/{id}" url +="?entityId=8ac7a4c7761cdc4a01761f34e79b09a1" val conn = new URL(url).openConnection() conn match { case secureConn: HttpsURLConnection => secureConn.setRequestMethod("DELETE") case _ => throw new ClassCastException } conn.setRequestProperty("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") conn.connect() if (conn.getResponseCode() >= 400) { return IOUtils.toString(conn.getErrorStream()) } else { return IOUtils.toString(conn.getInputStream()) } }
https://test.como.world/scheduling/v1/schedules/
Public Function Request() As Dictionary(Of String, Object) Dim url As String = "https://test.como.world/scheduling/v1/schedules/{id}" + "?entityId=8ac7a4c7761cdc4a01761f34e79b09a1" Dim req As WebRequest = WebRequest.Create(url) req.Method = "DELETE" req.Headers.Add("Authorization", "Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg==") req.ContentType = "application/x-www-form-urlencoded" Dim res As WebResponse = req.GetResponse() Dim resStream = res.GetResponseStream() Dim reader As New StreamReader(resStream) Dim response As String = reader.ReadToEnd() reader.Close() resStream.Close() res.Close() Dim jss As New System.Web.Script.Serialization.JavaScriptSerializer() Dim dict As Dictionary(Of String, Object) = jss.Deserialize(Of Dictionary(Of String, Object))(response) Return dict End Function responseData = Request()("result")("description")
https://test.como.world/scheduling/v1/schedules/8a82944a4cc25ebf014cc2c782423202
Authorization | Bearer OGFjN2E0Yzc3NjFjZGM0YTAxNzYxZjM0ZTc5YjA5YTB8V0duZ0Q4WGFYRg== |
entityId=8ac7a4c7761cdc4a01761f34e79b09a1