×

This API allows to update the settings parameters in an existing active ExoBridge account. Any parameter that is not passed in the body of the update request will retain the default/last saved value. 

PUT

https://leadassist.exotel.in/v1/tenants/<your_sid>/settings

Replace <your_sid> with your tenant ID.
The following table explains all the parameters that can be updated via this API.

Common Parameters (GreenVN and GreenPin):

Parameter Name Mandatory
/Optional
Value / Description
country optional Valid country code in ISO 3166-1 alpha-2 format. This is a two letter country code format. The default value is "IN"
intl_num_sup optional

Valid values: "true"/"false"; Flag to be used to enable or disable support for international numbers. The default value is "false"

max_deallocation_time optional

The max time limit to deallocate if a deallocation_policy is not mentioned. This setting will override the deallocation_policy if the duration in the deallocation_policy is greater than this value.

The maximum time period that can be set is 170 days and the default value is "170d"
Note: (d -> days, m -> minutes, h -> hours, s -> seconds)
In the case an allocation has to exist indefinitely, the  max_deallocation_time can be set to "-1"

timezone optional

The time zone to be used for the account. The default value is "IST" and the valid values are "IST" and "UTC"

deletion_time
optional

Integer value denoting seconds eg: 1800
This indicated the vault/cool-off period (in secs) before a GreenVN/GreenPin can be reutilised.
Valid Rage: [0 - 86400]
Default value: 0
Note:- Here 86400 seconds corresponds to 1 day

tag_enabled
optional

Valid values: "true"/"false"; Flag to be set if tags are to be sent or not in the params of the StatusCallBack URLs. The default value is "false". Additionally, please reach out to your account manager for this setting.

aparty_tag
optional The default A-party tag that will be used if no tag is passed in the allocation request and tag_enabled is "true". The default value is "aparty"
bparty_tag
optional The default B-party tag that will be used if no tag is passed in the allocation request and tag_enabled is "true. The default value is "bparty"
sms_config
optional The SMS configuration to be used for any outbound SMSs triggered
sticky_agent_enabled
optional Valid values: "true"/"false"; Flag to be set if the Sticky Agent feature is to be enabled or disabled. The default value is "false"
lcr_enabled
optional Valid values: "true"/"false"; Flag to be set if the Least Cost Routing mechanism is to be enabled or not. The default value is "false". This flag ensures that a VN from the region to which the a-party number belongs to is preferred over any other region. For eg: A number from the KA region will be returned a KA VN (depending on the VN availability in the pool)
default_region
optional The default supported region. The default value is "KA"

GreenVN Parameters:

Parameter Name

Mandatory
/Optional

Value / Description
greencall_complete_event_endpoint Optional An endpoint url that will be hit when the GreenVN call completes. Please refer to this link to see all the information that is sent to the endpoint passed in this parameter.
greencall_complete_event_method Optional

Valid values are:
1. "GET" - sends a GET request to the given endpoint
2. "POST" - sends a POST request to the given endpoint
3. "POST_XML" - sends a POST request to the given endpoint and the response shall be in XML format
4. "POST_JSON" - sends a POST request to the given endpoint and response shall be in JSON format

greencall_complete_event_headers Optional

A valid header. Eg:
"{\"content_type\": \"application/json\"}"

Accepted content_type values are:
1. "json"
2. "application/json"
3. "application/xml"

failed_verification_event_endpoint Optional An endpoint url that will be hit when the verification fails for an invalid caller
failed_verification_event_method Optional

Valid values are:
1. "GET" - sends a GET request to the given endpoint
2. "POST" - sends a POST request to the given endpoint
3. "POST_XML" - sends a POST request to the given endpoint and the response shall be in XML format
4. "POST_JSON" - sends a POST request to the given endpoint and response shall be in JSON format

failed_verification_event_headers Optional

A valid header. Eg:
"{\"content_type\": \"application/json\"}"

Accepted content_type values are:
1. "json"
2. "application/json"
3. "application/xml"

verified_caller_event_endpoint

Optional An endpoint url that will be hit when the caller is successfully verified
verified_caller_event_method Optional

Valid values are:
1. "GET" - sends a GET request to the given endpoint
2. "POST" - sends a POST request to the given endpoint
3. "POST_XML" - sends a POST request to the given endpoint and the response shall be in XML format
4. "POST_JSON" - sends a POST request to the given endpoint and response shall be in JSON format

verified_caller_event_headers Optional

A valid header. Eg:
"{\"content_type\": \"application/json\"}"

Accepted content_type values are:
1. "json"
2. "application/json"
3. "application/xml"

deallocation_callback_event_endpoint Optional

An endpoint url that will be hit when a deallocation happen (only via the deallocation policy)

deallocation_callback_event_method Optional

Valid values are:
1. "GET" - sends a GET request to the given endpoint
2. "POST" - sends a POST request to the given endpoint
3. "POST_XML" - sends a POST request to the given endpoint and the response shall be in XML format
4. "POST_JSON" - sends a POST request to the given endpoint and response shall be in JSON format

deallocation_callback_event_headers Optional

A valid header. Eg:
"{\"content_type\": \"application/json\"}"

Accepted content_type values are:
1. "json"
2. "application/json"
3. "application/xml"

default_flow_id Optional eg. "123456". The Flow ID is a unique identifier of a call flow. Please reach out to your Account Manager to get the Flow ID value. 
Note:- The Flow ID will be applicable only when there are different ExoBridge flows configured within the same account.

GreenPin Parameters:

Parameter Name Mandatory
/Optional
Value / Description
greenpin_call_complete_event_endpoint Optional An endpoint url that will hit when the GreenPin call completes. Please refer to this link to see all the information that is sent to the endpoint passed in this parameter.
greenpin_call_complete_event_method Optional

Valid values are:
1. "GET" - sends a GET request to the given endpoint
2. "POST" - sends a POST request to the given endpoint
3. "POST_XML" - sends a POST request to the given endpoint and the response shall be in XML format
4. "POST_JSON" - sends a POST request to the given endpoint and response shall be in JSON format

greenpin_call_complete_event_headers Optional

A valid header. Eg:
"{\"content_type\": \"application/json\"}"

Accepted content_type values are:
1. "json"
2. "application/json"
3. "application/xml"

greenpin_failed_verification_event_endpoint Optional

An endpoint url that will hit when the verification fails for an invalid caller. Please refer to this link to see all the information that is sent to the endpoint passed in this parameter.

greenpin_failed_verification_event_method
Optional

Valid values are:
1. "GET" - sends a GET request to the given endpoint
2. "POST" - sends a POST request to the given endpoint
3. "POST_XML" - sends a POST request to the given endpoint and the response shall be in XML format
4. "POST_JSON" - sends a POST request to the given endpoint and response shall be in JSON format

greenpin_failed_verification_event_headers
Optional

A valid header. Eg:
"{\"content_type\": \"application/json\"}"

Accepted content_type values are:
1. "json"
2. "application/json"
3. "application/xml"

greenpin_verified_caller_event_endpoint
Optional

An endpoint url that will hit when an unverified caller is successfully verified. Please refer to this link to see all the information that is sent to the endpoint passed in this parameter.

greenpin_verified_caller_event_method

Optional

Valid values are:
1. "GET" - sends a GET request to the given endpoint
2. "POST" - sends a POST request to the given endpoint
3. "POST_XML" - sends a POST request to the given endpoint and the response shall be in XML format
4. "POST_JSON" - sends a POST request to the given endpoint and response shall be in JSON format

greenpin_verified_caller_event_headers

 

Optional

A valid header. Eg:
"{\"content_type\": \"application/json\"}"

Accepted content_type values are:
1. "json"
2. "application/json"
3. "application/xml"

greenpin_deallocation_callback_event_endpoint
Optional

An endpoint url that will hit when a deallocation happen (only via the deallocation policy). Please refer to this link to see all the information that is sent to the endpoint passed in this parameter.

greenpin_deallocation_callback_event_method Optional

Valid values are:
1. "GET" - sends a GET request to the given endpoint
2. "POST" - sends a POST request to the given endpoint
3. "POST_XML" - sends a POST request to the given endpoint and the response shall be in XML format
4. "POST_JSON" - sends a POST request to the given endpoint and response shall be in JSON format

greenpin_deallocation_callback_event_headers
Optional

A valid header. Eg:
"{\"content_type\": \"application/json\"}"

Accepted content_type values are:
1. "json"
2. "application/json"
3. "application/xml"

aparty_pin_length Optional

Desired length of A-Party pin. Allowed values are 1 to 9 and the default value is 4 (int)

bparty_pin_length Optional Desired length of B-Party pin. Allowed values are 1 to 9 and the default value is 4 (int)
common_pin_length Optional If no pin_length preference is passed for either of the parties, then the value present in the common_pin_length will be used. Allowed values are 1 to 9 and the default value is 4 (int)
aparty_pin_enabled Optional Valid values: "true"/"false"; Flag to be set if an A-party pin is required or not. The default value is "false"
bparty_pin_enabled Optional Valid values: "true"/"false"; Flag to be set if an B-party pin is required or not. The default value is "false"
common_pin_enabled Optional Valid values: "true"/"false"; Flag to be set if a common pin length is to be used for both the parties. The default value is "false"

Please note that all the above parameters accept String values unless mentioned otherwise (as int or integer) in the description column. Also, please ensure that for every event_endpoint parameter passed, a corresponding event_headers and event_method parameter is also passed, with valid values, to ensure the concerned endpoint is hit appropriately.

curl -X PUT \  
https://leadassist.exotel.in/v1/tenants/<your_sid>/settings \  
-H 'Authorization: Basic <your Auth string which is Base64 encoded version of “username:Password” string>' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \ 
-d '{
"greenvn": {
"deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"deallocation_callback_event_method": "POST_JSON",
"deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"greencall_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greencall_complete_event_method": "POST_JSON",
"greencall_complete_event_headers": "{\"content_type\": \"application/json\"}",
"verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"verified_caller_event_method": "POST_JSON",
"verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"failed_verification_event_method": "POST_JSON",
"failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"default_flow_id": "123456"
},
"greenpin": {
"greenpin_call_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_call_complete_event_method": "POST_JSON",
"greenpin_call_complete_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_failed_verification_event_method": "POST_JSON",
"greenpin_failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_verified_caller_event_method": "POST_JSON",
"greenpin_verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_deallocation_callback_event_method": "POST_JSON",
"greenpin_deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"aparty_pin_length": 4,
"bparty_pin_length": 4,
"common_pin_length": 4,
"aparty_pin_enabled": "false",
"bparty_pin_enabled": "false",
"common_pin_enabled": "false"
},
"common": {
"country": "IN",
"intl_num_sup": "false",
"max_deallocation_time": "-1",
"timezone": "IST",
"deletion_time": 1800,
"tag_enabled": "true",
"aparty_tag": "Customer",
"bparty_tag": "Courier",
"sms_config": "{\"A\": {\"sms_enabled\": \"false\", \"on_status\": [\"busy\",\"no-answer\",\"failed\",\"canceled\"],\"DltTemplateId\": \"xxxxxx008620xxx63xx\",\"DltEntityId\": \"xxxxxx874xxxxx1272\",\"sender_id\": \"MONOTEL\",\"sms_body\": \"Hello and welcome to Exotel. Your phone number 09xxxxx932 is verified. From now on you will be to able make and recieve calls from your Exotel account. You can switch on/off your device by giving a missedcall to 0xxxxx85696.\"},\"B\": {\"sms_enabled\": \"false\"}}",
"sticky_agent_enabled": "true",
"lcr_enabled": "true",
"default_region": "KA"
}
}'
var request = require("request");
var accountSid = "XXXXXXXXX";
var accountToken = "YYYYYYYYY";
var authKey = "ZZZZZZZZZZ";

var encoding = Buffer.from(authKey + ':' + accountToken).toString('base64')

var options = { 
  	method: 'PUT',
    'url': 'https://leadassist.exotel.in/v1/tenants/'+accountSid+'/settings',
    'headers': {
        'Authorization': 'Basic'+ encoding,
        'Content-Type': 'application/json'
    },
  body: JSON.stringify({
"greenvn": {
"deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"deallocation_callback_event_method": "POST_JSON",
"deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"greencall_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greencall_complete_event_method": "POST_JSON",
"greencall_complete_event_headers": "{\"content_type\": \"application/json\"}",
"verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"verified_caller_event_method": "POST_JSON",
"verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"failed_verification_event_method": "POST_JSON",
"failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"default_flow_id": "123456"
},
"greenpin": {
"greenpin_call_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_call_complete_event_method": "POST_JSON",
"greenpin_call_complete_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_failed_verification_event_method": "POST_JSON",
"greenpin_failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_verified_caller_event_method": "POST_JSON",
"greenpin_verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_deallocation_callback_event_method": "POST_JSON",
"greenpin_deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"aparty_pin_length": 4,
"bparty_pin_length": 4,
"common_pin_length": 4,
"aparty_pin_enabled": "false",
"bparty_pin_enabled": "false",
"common_pin_enabled": "false"
},
"common": {
"country": "IN",
"intl_num_sup": "false",
"max_deallocation_time": "-1",
"timezone": "IST",
"deletion_time": 1800,
"tag_enabled": "true",
"aparty_tag": "Customer",
"bparty_tag": "Courier",
"sms_config": "{\"A\": {\"sms_enabled\": \"false\", \"on_status\": [\"busy\",\"no-answer\",\"failed\",\"canceled\"],\"DltTemplateId\": \"xxxxxx008620xxx63xx\",\"DltEntityId\": \"xxxxxx874xxxxx1272\",\"sender_id\": \"MONOTEL\",\"sms_body\": \"Hello and welcome to Exotel. Your phone number 09xxxxx932 is verified. From now on you will be to able make and recieve calls from your Exotel account. You can switch on/off your device by giving a missedcall to 0xxxxx85696.\"},\"B\": {\"sms_enabled\": \"false\"}}",
"sticky_agent_enabled": "true",
"lcr_enabled": "true",
"default_region": "KA"
}
})

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
<?php
$curl = curl_init();
$accountSid = "XXXXXXXXXX";
$accountToken = "YYYYYYYYYY";
$authKey = "ZZZZZZZZZZ";

$encoding = base64_encode($authKey .":". $accountToken);
curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://leadassist.exotel.in/v1/tenants/'+$accountSid+'/settings',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'PUT',
  CURLOPT_POSTFIELDS =>'{
"greenvn": {
"deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"deallocation_callback_event_method": "POST_JSON",
"deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"greencall_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greencall_complete_event_method": "POST_JSON",
"greencall_complete_event_headers": "{\"content_type\": \"application/json\"}",
"verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"verified_caller_event_method": "POST_JSON",
"verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"failed_verification_event_method": "POST_JSON",
"failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"default_flow_id": "123456"
},
"greenpin": {
"greenpin_call_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_call_complete_event_method": "POST_JSON",
"greenpin_call_complete_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_failed_verification_event_method": "POST_JSON",
"greenpin_failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_verified_caller_event_method": "POST_JSON",
"greenpin_verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_deallocation_callback_event_method": "POST_JSON",
"greenpin_deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"aparty_pin_length": 4,
"bparty_pin_length": 4,
"common_pin_length": 4,
"aparty_pin_enabled": "false",
"bparty_pin_enabled": "false",
"common_pin_enabled": "false"
},
"common": {
"country": "IN",
"intl_num_sup": "false",
"max_deallocation_time": "-1",
"timezone": "IST",
"deletion_time": 1800,
"tag_enabled": "true",
"aparty_tag": "Customer",
"bparty_tag": "Courier",
"sms_config": "{\"A\": {\"sms_enabled\": \"false\", \"on_status\": [\"busy\",\"no-answer\",\"failed\",\"canceled\"],\"DltTemplateId\": \"xxxxxx008620xxx63xx\",\"DltEntityId\": \"xxxxxx874xxxxx1272\",\"sender_id\": \"MONOTEL\",\"sms_body\": \"Hello and welcome to Exotel. Your phone number 09xxxxx932 is verified. From now on you will be to able make and recieve calls from your Exotel account. You can switch on/off your device by giving a missedcall to 0xxxxx85696.\"},\"B\": {\"sms_enabled\": \"false\"}}",
"sticky_agent_enabled": "true",
"lcr_enabled": "true",
"default_region": "KA"
}
}',
  CURLOPT_HTTPHEADER => array(
    'Authorization: Basic '+ $encoding,
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
import requests, base64, json

accountSid = "XXXXXXXXX"
authToken = "YYYYYYYYY"
authKey = "ZZZZZZZZZZ"

encoding = base64.b64encode(authKey + ":" + authToken)

url = "https://leadassist.exotel.in/v1/tenants/"+ accountSid+"/settings"

payload = json.dumps({
"greenvn": {
"deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"deallocation_callback_event_method": "POST_JSON",
"deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"greencall_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greencall_complete_event_method": "POST_JSON",
"greencall_complete_event_headers": "{\"content_type\": \"application/json\"}",
"verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"verified_caller_event_method": "POST_JSON",
"verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"failed_verification_event_method": "POST_JSON",
"failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"default_flow_id": "123456"
},
"greenpin": {
"greenpin_call_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_call_complete_event_method": "POST_JSON",
"greenpin_call_complete_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_failed_verification_event_method": "POST_JSON",
"greenpin_failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_verified_caller_event_method": "POST_JSON",
"greenpin_verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_deallocation_callback_event_method": "POST_JSON",
"greenpin_deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"aparty_pin_length": 4,
"bparty_pin_length": 4,
"common_pin_length": 4,
"aparty_pin_enabled": "false",
"bparty_pin_enabled": "false",
"common_pin_enabled": "false"
},
"common": {
"country": "IN",
"intl_num_sup": "false",
"max_deallocation_time": "-1",
"timezone": "IST",
"deletion_time": 1800,
"tag_enabled": "true",
"aparty_tag": "Customer",
"bparty_tag": "Courier",
"sms_config": "{\"A\": {\"sms_enabled\": \"false\", \"on_status\": [\"busy\",\"no-answer\",\"failed\",\"canceled\"],\"DltTemplateId\": \"xxxxxx008620xxx63xx\",\"DltEntityId\": \"xxxxxx874xxxxx1272\",\"sender_id\": \"MONOTEL\",\"sms_body\": \"Hello and welcome to Exotel. Your phone number 09xxxxx932 is verified. From now on you will be to able make and recieve calls from your Exotel account. You can switch on/off your device by giving a missedcall to 0xxxxx85696.\"},\"B\": {\"sms_enabled\": \"false\"}}",
"sticky_agent_enabled": "true",
"lcr_enabled": "true",
"default_region": "KA"
}
})

headers = {
  'Authorization': 'Basic '+ encoding,
  'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, data=payload)

print(response.text)
package main

import (
	b64 "encoding/base64"
	"fmt"
	"io/ioutil"
	"net/http"
	"strings"
)

func main() {
	// Please provide accountSid, authToken from your Exotel account
	accountSid := "XXXXXXXXX"
	authToken := "YYYYYYYY"
	authKey := "ZZZZZZZZZZ"

	// Encoding the accountSid and authToken, used in Authorization header
	encoding := b64.StdEncoding.EncodeToString([]byte(authKey + ":" + authToken))
	url := "https://leadassist.exotel.in/v1/tenants/" + accountSid + "/settings"

	payload := strings.NewReader(`{
"greenvn": {
"deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"deallocation_callback_event_method": "POST_JSON",
"deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"greencall_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greencall_complete_event_method": "POST_JSON",
"greencall_complete_event_headers": "{\"content_type\": \"application/json\"}",
"verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"verified_caller_event_method": "POST_JSON",
"verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"failed_verification_event_method": "POST_JSON",
"failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"default_flow_id": "123456"
},
"greenpin": {
"greenpin_call_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_call_complete_event_method": "POST_JSON",
"greenpin_call_complete_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_failed_verification_event_method": "POST_JSON",
"greenpin_failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_verified_caller_event_method": "POST_JSON",
"greenpin_verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
"greenpin_deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
"greenpin_deallocation_callback_event_method": "POST_JSON",
"greenpin_deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
"aparty_pin_length": 4,
"bparty_pin_length": 4,
"common_pin_length": 4,
"aparty_pin_enabled": "false",
"bparty_pin_enabled": "false",
"common_pin_enabled": "false"
},
"common": {
"country": "IN",
"intl_num_sup": "false",
"max_deallocation_time": "-1",
"timezone": "IST",
"deletion_time": 1800,
"tag_enabled": "true",
"aparty_tag": "Customer",
"bparty_tag": "Courier",
"sms_config": "{\"A\": {\"sms_enabled\": \"false\", \"on_status\": [\"busy\",\"no-answer\",\"failed\",\"canceled\"],\"DltTemplateId\": \"xxxxxx008620xxx63xx\",\"DltEntityId\": \"xxxxxx874xxxxx1272\",\"sender_id\": \"MONOTEL\",\"sms_body\": \"Hello and welcome to Exotel. Your phone number 09xxxxx932 is verified. From now on you will be to able make and recieve calls from your Exotel account. You can switch on/off your device by giving a missedcall to 0xxxxx85696.\"},\"B\": {\"sms_enabled\": \"false\"}}",
"sticky_agent_enabled": "true",
"lcr_enabled": "true",
"default_region": "KA"
}
}`)

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("Authorization", "Basic "+encoding)
	req.Header.Add("cache-control", "no-cache")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

HTTP Response:

  • On success, the HTTP response status code will be 200
  • The response will display all the settings for the account and not just the updated params
{
  "request_id": "74c6a618-7534-4e0d-bd52-28e0530ef54b",
  "success": true,
  "status": 200,
  "code": null,
  "message": null,
  "method": "PUT",
  "data": {
    "greenvn": {
      "greencall_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
      "greencall_complete_event_method": "POST_JSON",
      "greencall_complete_event_headers": "{\"content_type\": \"application/json\"}",
      "failed_verification_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
      "failed_verification_event_method": "POST_JSON",
      "failed_verification_event_headers": "{\"content_type\": \"application/json\"}",
      "verified_caller_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
      "verified_caller_event_method": "POST_JSON",
      "verified_caller_event_headers": "{\"content_type\": \"application/json\"}",
      "deallocation_callback_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
      "deallocation_callback_event_method": "POST_JSON",
      "deallocation_callback_event_headers": "{\"content_type\": \"application/json\"}",
      "default_flow_id": "123456"
    },
    "greenpin": {
      "greenpin_call_complete_event_endpoint": "https://webhook.site/68c6f127-6ac0-46b8-a8e5-8b8dae5b6e27",
      "greenpin_call_complete_event_method": "POST_JSON",
      "greenpin_call_complete_event_headers": "{\"content_type\": \"application/json\"}",

      "aparty_pin_length": 4,
      "bparty_pin_length": 4,
      "common_pin_length": 4,
      "aparty_pin_enabled": "false",
      "bparty_pin_enabled": "false",
      "common_pin_enabled": "false"
    },
    "common": {
      "country": "IN",
      "intl_num_sup": "false",
      "max_deallocation_time": "-1",
      "timezone": "IST",
      "deletion_time": 1800,
      "tag_enabled": "true",
      "aparty_tag": "Customer",
      "bparty_tag": "Courier",
      "sms_config": "{\"A\": {\"sms_enabled\": \"false\", \"on_status\": [\"busy\",\"no-answer\",\"failed\",\"canceled\"],\"DltTemplateId\": \"xxxxxx008620xxx63xx\",\"DltEntityId\": \"xxxxxx874xxxxx1272\",\"sender_id\": \"MONOTEL\",\"sms_body\": \"Hello and welcome to Exotel. Your phone number 09xxxxx932 is verified. From now on you will be to able make and recieve calls from  your Exotel account. You can switch on/off your device by giving a missedcall to 0xxxxx85696.\"},\"B\": {\"sms_enabled\": \"false\"}}",
      "sticky_agent_enabled": "true",
      "default_region": [
        "KA"
      ],
      "lcr_enabled": "true"
    }
  }
}