API version 2

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

API key verification(user/check)

Verification of the correct API key entered by the user.

URL request:
https://salesscriptprompter.com/integration/apiv2/user/check?key=API-KEY
Response example:
{
  "key": 'key',
  "user_id": 0
}

User list (user/list)

Lists your users with their roles and authorization keys.

URL request:
https://salesscriptprompter.com/integration/apiv2/user/list?key=API-KEY
Response example:
[
    {"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":123458,"role":"user_operator","login":"[email protected]","auth_token":"key 3"}
]

User authorization (user/auth)

Authorizes the user by ID and authorization token.

URL request:
https://salesscriptprompter.com/integration/apiv2/user/auth?key=USER_KEY&id=USER_ID&token=USER_TOKEN
Parameters:
  • id [required] — user ID
  • token [required] — User authorization token
Response:

Redirects to the main page.

List of scripts (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.

URL request:
https://salesscriptprompter.com/integration/apiv2/script/list?key=API-KEY
Response example:
[
  {
    "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
  }
]

Add call record (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.

URL request:
https://salesscriptprompter.com/integration/apiv2/call/attach-record?key=API-KEY&id=1234&url=http%3A%2F%2Frecords-server.ru%2Frecord_123.mp3
Parameters:
  • id [required] — call ID. You can get the call ID using WebHooks
  • url [required] — conversation record URL (urlencoded string)

List of custom fields (field/list)

Returns a list of fields that can be used when running scripts.

URL request:
https://salesscriptprompter.com/integration/apiv2/field/list?key=API-KEY
Response example:
[
    {"id":1,"code":"name","account_id":1,"name":"Имя","type":"string","type_data":""},
    {"id":2,"code":"gender","account_id":1,"name":"Пол","type":"in","type_data":"М, Ж"}
]

Create a custom field (field/create)

Creates a custom field

Parameters:
  • 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`)
URL request:
https://salesscriptprompter.com/integration/apiv2/field/create?key=API-KEY&code=name&name=%D0%98%D0%BC%D1%8F&type=string
Response example:
{result: true}
{result: false, errors: []}

Change custom field (field/update)

Changes the custom field

Parameters:
  • 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`)
URL request:
https://salesscriptprompter.com/integration/apiv2/field/update?key=API-KEY&code=name&name=Name
Response example:
{result: true}
{result: false, errors: []}

Delete custom field (field/delete)

Delete the custom field

Parameters:
  • code [required] — field code used to identify the field when running scripts
URL request:
https://salesscriptprompter.com/integration/apiv2/field/delete?key=API-KEY&code=name
Response example:
{result: true}
Яндекс.Метрика