Creating broker applications

Parameters

HTTP method

Access rights

URL

Parameters

Note

POST manage_broker_application https://api.admitad.com/website/{w_id}/broker/applications/create/ List of request parameters

Returns the created application, where w_id is the ad space ID.*

  • * Returns the result in the JSON format.

List of request parameters

Name

Description

Type

Requirements

campaigns *

List of program IDs to which applications or Application submittal algorithm must be submitted.

list List of affiliate programs (has_tool=broker_traffic)
user_notified *

The value “1” indicates that the user has read and agreed with the purpose of data collection, the processing of data, the list of third parties to whom data will be transferred, and the user’s rights under point 2.1 of the Rules for Using the Broker Tool. “0” indicates that the user has not read and has not agreed with the above. If the value is “0,” the user’s form will not be sent through the API.

bool

1 or 0

test_mode

An application will be sent in test mode. In test mode there will be no ‘id’ in the response and ‘responses’ field will be empty.

bool

1 or 0

The other Application parameters

     
  • * Required parameter

Example of use

Example of a request with utility ``curl``:

curl -H 'Authorization: Bearer access_token' -X POST https://api.admitad.com/website/{w_id}/broker/applications/create/ \
     -F 'campaigns=[17809, 17810]' \
     -F 'first_name=Иван' \
     -F 'last_name=Иванов' \
     -F 'middle_name=Иванович' \
     -F 'mobile_phone=03512345678' \
     -F 'work_date=11.11.2016' \
     -F 'email=ivanov11123test@gmail.com'

where 17809, 17810 are program IDs that accept API applications, Ivanov Ivan Ivanovich is an application creator, with the cell phone number: 03512345678, email: ivanov11123test@gmail.com, and 11.11.2016 as the first employment day.

Application submittal algorithm

The “campaings” parameter can receive the JSON array with application submittal algorithm

campaigns=[{"ids": [17809, 16126], "pause": 0}, {"ids": [17288, 16651], "pause": 150}, {"ids": [16633], "pause": 80}]

where:

  • ids — a list off group’s program IDs

  • pause — a pause in minutes prior to sending the group (max. value is 1440 min, i.e. a day).

As the example above shows, the application for the first group [17809, 16126] will be sent immediately. If at least one application is successful (meaning, accepted via the API w/o rejections by an advertiser), submittal of an application to the second group of programs [17288, 16651] will be initiated. If all the applications from the first group are rejected, then the submittal of the application to the second group of programs will be initiated immediately, i.e. without a 150 min break. Following the same principle, the application will be sent to the third group in 80 min or immediately.

Different variations of recording the “campaigns” parameter are supported, such as:

[17809, 16126, [17288, 16651], {"ids": [16633]}, {"ids": [16326, 14605], "pause": 150}]

equals to recoding:

[{"ids": [17809], "pause": 0},
 {"ids": [16126], "pause": 0},
 {"ids": [17288, 16651], "pause": 0},
 {"ids": [16633], "pause": 0},
 {"ids": [16326, 14605], "pause": 150}]

You may see how your record is interpreted in “algorithm” parameter of the API server response.

Example of the response from the API server in the JSON format:

{
    "id": 1,
    "subid": "",
    "subid1": "",
    "subid3": "",
    "subid2": "",
    "subid4": "",
    "responses": [
        {
            "campaign_id": 17809,
            "status": "processing",
            "order_id": null,
            "server_response": {
                "message": "objects_list_returned_ok",
                "code": 200,
                "data": false
            }
        }
    ],
    "errors": [
        {
            "campaign_id": 17810,
            "message": "Кампания не принимает заявки брокеров."
        }
    ],
    "algorithm": [{"ids": [17809], "pause": 0}],
}

Description of API server response fields

Name

Description

id

Application ID

responses

Information about sending an application in the program

errors

Error when creating an application

subid

Additional parameter

subid1

Additional parameter 1

subid2

Additional parameter 2

subid3

Additional parameter 3

subid4

Additional parameter 4

algorithm Application submittal algorithm

Description of the fields in the information about sending an application in the program

Name

Description

campaign_id

Program ID

status
Application status
  • processing (waiting to be sent to the program)

  • approved (approved by the program)

  • declined (declined by the program)

  • waiting (being processed by the program)

  • error (errors on the side of the program)

order_id

Order ID in the system

server_response

Advertiser server response

Description of the fields of errors when creating an application

Name

Description

campaign_id

Program ID

message

Error message