Renew / Re-Upload OBD Audio Library Voice Call API Documentation

Renew / Re-Upload OBD Audio Library

Audio libraries will be alive in your personal library for a period of 1 month and after that system will automatically delete it from the system. If your campaign goes on more than for a month for the same OBD audio file, then you can renew its timestamp.

Re-upload of audio library will take place only if recently we might have shifted you the gateway, you need to re-upload OBD audio track to ensure we send out the audio track to whitelist with the changed gateway operator.

Execute Java Sample Code - Live Demo

 

Import Voice Call API postman collection.

Postman Collection

 

Application API URL:

https://www.smsgateway.center/VoiceApi/rest/save

Key Value Description
Login Credentials (Required Parameters)
Authenticate your API request using userId-password or apiKey. You should use either one to authenticate your login.
userId Your Registered Username The registered username parameter to be passed. You can use this if apiKey is not being used.
password Your password The password needs to be urlencoded if there are any special characters used in the password field. You can use this if apiKey is not being used.
apiKey Your unique apiKey apiKey needs to be sent as HTTP header when you are not using userId and password credentials. You can avail this from your user control panel and use instead of userId and password HTTP Request parameter. Please do not disclose this to anyone.
Required Parameters
reUpload true|false Default parameter is false Your library upload will be active for 1 month, if you want to renew your timestamp or if your voice gateway has been changed then you need to use this parameter to reupload and get it approved from the new operator. Set true to re-upload/renew.
libraryId library ID (Integer) This is the library ID which you want to renew/re-upload OBD audio track or timestamp.
Default Parameters (Optional)
format plain|json|xml Value for response format.

System default is plain. If you need responses in JSON or XML then you have to give value as JSON or XML.

Save this Page on your Favorite Social Media

Sample Request Code

POST METHOD

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/VoiceApi/rest/save",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "userId=YourUsername&password=YourPassword&libraryId=3244046971344996976&reUpload=true&format=json",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

POST METHOD

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://www.smsgateway.center/VoiceApi/rest/save?userId=YourUsername&password=YourPassword&libraryId=3244046971344996976&reUpload=true&format=json",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

POST METHOD

import java.io.*;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;


public class SMSGatewayCenterVoiceLib{

public static void main(String[] args)
{
//OR
String userId = "YourUsername";
String password = "YourPassword";
//Your active library id
String libraryId = "3244046971344996976";
//set to true to reupload/renew
String reUpload = "true";
//response format
String format = "json";

//Prepare Url
URLConnection myURLConnection=null;
URL myURL=null;
BufferedReader reader=null;

//API End Point
String mainUrl="https://www.smsgateway.center/VoiceApi/rest/save?";

//API Paramters
StringBuilder sendVoiceData= new StringBuilder(mainUrl);
sendVoiceData.append("&userId="+userId);
sendVoiceData.append("&password="+password);
sendVoiceData.append("&libraryId="+libraryId);
sendVoiceData.append("&reUpload="+reUpload);
sendVoiceData.append("&format="+format);
//final string
mainUrl = sendVoiceData.toString();
try
{
//prepare connection
myURL = new URL(mainUrl);
myURLConnection = myURL.openConnection();
myURLConnection.connect();
reader= new BufferedReader(new InputStreamReader(myURLConnection.getInputStream()));
//reading response
String response;
while ((response = reader.readLine()) != null)
//print response
System.out.println(response);

//finally close connection
reader.close();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}

Response

{
    "status": "success"
    "libraryId": "3509517028302932557",
    "frequency": 11000,
    "length": 12,
    "statusCode": "900",
    "reason": "success",
}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<voiceUploadResponse>
    <frequency>44100</frequency>
    <length>2</length>
    <libraryId>5784862973990422090</libraryId>
    <reason>success</reason>
    <status>success</status>
    <statusCode>900</statusCode>
</voiceUploadResponse>
status=success | libraryId=826485878102966548 | frequency=11000 | length=12 | errorCode=900 | reason=success