Customer Identification
In most requests to the Sailplay server, it is necessary to pass the client ID in order to perform certain actions with it. For example, such as:
- check if it exists in the database;
- assign a tag;
- associate with a purchase, etc.
In the documentation for the methods, we specify the client's phone number as the client identifier — user_phone. However, it is also allowed to pass another identifier: email or origin_user_id.
Additional client identifiers
In Sailplay, it is possible to specify additional identifiers for clients and use them for integration when sending API requests. As identifiers, you can use:
- cookie files from the site;
- second phone number;
- second email, etc.
All existing public API methods that accept user_phone, email or origin_user_id can accept new identifiers. To do this, instead of user_phone, email or origin_user_id, you need to pass two parameters in the request:
- identification — the name of the identifier;
- lookup — the value of the identifier.
To use this functionality, you need to send a request to register a new client identifier to support@sailplay.net and wait for it to be added.
Varieties of requests with different identifiers
curl --request POST \
--url https://sailplay.net/api/v2/users/tags/add/ \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data token=d21a23d5ff695377ca99a3a6cf9b4a1ec6452b00 \
--data store_department_id=14864 \
--data user_phone= 79653215476 \
--data 'tags=Tag1'
curl --request POST \
--url https://sailplay.net/api/v2/users/tags/add/ \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data token=d21a23d5f2295377ca99a3a6cf9b4a1ec6452b00 \
--data store_department_id=14864 \
--data email= example@example.com \
--data 'tags=Tag1,Tag2,Tag3'
curl --request POST \
--url https://sailplay.net/api/v2/users/tags/add/ \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data token=d21a23d5ff6953722a99a3a6cf9b4a1ec6452b00 \
--data store_department_id=14864 \
--data origin_user_id= uid23 \
--data 'tags=Tag1,Tag2,Tag3'
curl --request POST \
--url https://sailplay.net/api/v2/users/tags/add/ \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data token=d21a23d5ff695227ca99a3a6cf9b4a1ec6452b00 \
--data store_department_id=14864 \
--data identification=client_id_name \
--data lookup=client_id_value \
--data 'tags=Tag1'