Requests to the API are via HTTP protocol.
All requests have the form: https://salesscriptprompter.com/integration/apiv2/controller/method?key=API-KEY
https://salesscriptprompter.com/integration/apiv2
— this part of URL is permanent
controller/method
— routing for data acquisition. Options will be described below.
key
— the API key (so you can send as HTTP header - Key:Your API key
)
json | Response format - by default |
jsonp | To get a jsonp response, pass the GET parameter to "_format=jsonp". The name of the callback function can be passed in the GET parameter "callback=my_func", by default the name of the function "callback" is used |
user/check
)Verification of the correct API key entered by the user.
https://salesscriptprompter.com/integration/apiv2/user/check?key=API-KEY
{ "key": 'key', "user_id": 0 }
user/list
)Lists your users with their roles and authorization keys.
https://salesscriptprompter.com/integration/apiv2/user/list?key=API-KEY
[ {"id":123456,"role":"user_head_manager","login":"[email protected]","auth_token":"key 1"}, {"id":123457,"role":"user_designer","login":"[email protected]","auth_token":"key 2"}, {"id":123459,"role":"user_supervisor","login":"[email protected]","auth_token":"key 4"}, {"id":123458,"role":"user_operator","login":"[email protected]","auth_token":"key 3"} ]
user/auth
)Authorizes the user by ID and authorization token.
https://salesscriptprompter.com/integration/apiv2/user/auth?key=USER_KEY&id=USER_ID&token=USER_TOKEN
id
[required] — user ID
token
[required] — User authorization token
Redirects to the main page.
script/list
)Returns a list of user scripts. Every list item contains the script ID, title, and label – whether the script is published or not. By default, returns all published scripts.
https://salesscriptprompter.com/integration/apiv2/script/list?key=API-KEY
[ { "id": 1617, "name": "Prohod Sekretaria", "published": 0 }, { "id": 460, "name": "The purpose of the meeting", "published": 1 }, { "id": 198, "name": "Smart4smart 3.0", "published": 1 } ]
call/attach-record
)Attaches to call the URL of the record of the phone conversation. The URL must be accessible and lead to the audio file, so you can listen using the online player.
https://salesscriptprompter.com/integration/apiv2/call/attach-record?key=API-KEY&id=1234&url=http%3A%2F%2Frecords-server.ru%2Frecord_123.mp3
id
[required] — call ID. You can get the call ID using WebHooks
url
[required] — conversation record URL (urlencoded string)
field/list
)Returns a list of fields that can be used when running scripts.
https://salesscriptprompter.com/integration/apiv2/field/list?key=API-KEY
[ {"id":1,"code":"name","account_id":1,"name":"Имя","type":"string","type_data":""}, {"id":2,"code":"gender","account_id":1,"name":"Пол","type":"in","type_data":"М, Ж"} ]
field/create
)Creates a custom field
code
[required] — field code used to identify the field when running scripts
name
[required] — the name of the field
type
[required] — field type (possible values: string, number, date, boolean, in)
type_data
[optional] — choice options (to be filled in for field type `in`)
https://salesscriptprompter.com/integration/apiv2/field/create?key=API-KEY&code=name&name=%D0%98%D0%BC%D1%8F&type=string
{result: true}
{result: false, errors: []}
field/update
)Changes the custom field
code
[required] — field code used to identify the field when running scripts
name
[optional] — field name
type
[optional] — field type (possible values: string, number, date, boolean, in)
type_data
[optional] — choice options (to be filled in for field type `in`)
https://salesscriptprompter.com/integration/apiv2/field/update?key=API-KEY&code=name&name=Name
{result: true}
{result: false, errors: []}
field/delete
)Delete the custom field
code
[required] — field code used to identify the field when running scripts
https://salesscriptprompter.com/integration/apiv2/field/delete?key=API-KEY&code=name
{result: true}