In most requests to the Sailplay server, it is necessary to pass the client ID in order to perform some actions on it. For example, such as:
- check if it exists in the database
- assign a tag
- connect with the purchase and so on.
In the method documentation, we specify the client's phone, user_phone, as the identifier. However, it is allowed to pass another identifier instead: email or origin_user_id.
Additional Client Identifiers
Sailplay has the ability to specify additional identifiers for clients and use them in integration when sending API requests. The following can be used as identifiers:
- cookies 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 the new functionality, you need to send a request to register a new client ID to [email protected] and wait for the new ID to be registered.
Request variations with different IDs
curl --request POST \
--url https://sailplay.com/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.com/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 email= [email protected] \
--data 'tags=Tag1,Tag2,Tag3'curl --request POST \
--url https://sailplay.com/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 origin_user_id= uid23 \
--data 'tags=Tag1,Tag2,Tag3'curl --request POST \
--url https://sailplay.com/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 identification=client_id_name \
--data lookup=client_id_value \
--data 'tags=Tag1'