Outbound calls API error ( community version )

hi team,
need you urgent support
while trying to setup outbound calls with instructions from documentation Outbound Calling API (SAVG) – SmartAssist
got the below
{
“errors”: [
{
“msg”: “Permission denied. Scope is incorrect!”,
“code”: 4002
}
]
}
API scope created on smart assist as below

Hi @m.gamal ,
You need to enable API Scope (SmartAssist Dialout) by clicking on add API scope. Please find screenshot for reference.

Thanks

as attached screenshot api scope added

Hi @m.gamal

Please share the API cURL which you are using.

curl -X POST
https://smartassist.kore.ai/api/1.1/public/bot/:/smartassist/dialout
-H ‘Content-Type: application/json’
-H ‘Authorization: Your_Auth_Token_Here’
-d ‘{
“bot”: “st-c562d2bd-3dc2-5424-a3f8-e5d5d86f538e”,
“target”: “tel:+2xxxxxxxxx”,
“caller”: “+17828256726”
}’

Hi @m.gamal

Please try using your bot id in the URL.

For Ex - https://smartassist.kore.ai/api/1.1/public/bot/st-c562d2bd-3dc2-5424-a3f8-e5d5d86f538e/smartassist/dialout

Replace ‘:’ in the URL with bot id and let us know if you are still facing any issues.

i got error we are unable to complete this request right now please try again later

@m.gamal pls send screenshot of error. I can successfully test the API at my end. Pls double check if voice channel in instance bot is Audio codes or SAVG.

This API only works for SAVG.

Hi Ajay,
kindly note that voice channel is Audio but i can’t get a screenshot as its voice test

@m.gamal I was referring to the error screenshot (believe you would using Postman/ or similar tool for making API call)

However, you need to make sure your instance bot is not using Audio codes channel. (as mentioned API will only work for SAVG channel as indicated in document).

$data['target']='tel:MY_NUMBER';
$data['caller']='EXPERIENCE_FLOW_NUMBER';


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://smartassist.kore.ai/api/1.1/public/bot/st-7d2f9e90-7da7-5b01-b9cf-b9c9610c33d5/smartassist/dialout');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); 

$headers = array();
$headers[] = 'Auth: '.$token;
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

This is my code I am also facing the same permission issue. I have already given the permission in my smartassist app. If anyone know for this issue than can you please help me

Thanks

Hi @aspiringcoder5 I see you are using a PHP code, but can you confirm if the CURL is working from an API testing tool? I think you can troubleshoot is better with a tool.

Assuming you are passing all the headers and tokens are properly passed, Can you share what is the error you face?