Introduction
The Telecom Score API is designed to provide a score based on how frequently a phone number is topped up, making it a valuable tool for fraud prevention and user verification. This guide will walk you through how to integrate and use the API in your system.
Step-by-Step Guide to Integrate the Telecom Score API
1. Obtain API Access Token
Before making any requests, you need to authenticate by generating an API access token using your accessKey, secretKey, and a timestamp. Here's an example request:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"accessKey":"22********70b","signature":"f786441e7b3d95f*****************853a5a244f9522","timestamp":1648785145789,"periodSecond":120}' \
"https://api.advance.ai/openapi/auth/ticket/v1/generate-token"
2. Prepare the Telecom Score Request
Once you have your token, you can submit a telecom score request to the API. Here’s a sample curl request:
curl -X POST \
-H "X-ACCESS-TOKEN: {Your Access Token}" \
-H "Content-Type: application/json" \
-d '{"countryCode": "+62", "areaCode": "", "number": "8111100320"}' \
"https://api.advance.ai/openapi/anti-fraud/v1/tele-score"
3. Key Parameters for the Telecom Score Request
- X-ACCESS-TOKEN: Your access token obtained from the token generation API.
- countryCode: The country code of the phone number (e.g., +62 for Indonesia).
-
areaCode: The area code for landline numbers. If it's a mobile number, this field should be an empty string
"". - number: The mobile or landline phone number.
4. Handle the API Response
The API returns a score between 1 and 7, with 1 being the lowest and 7 the highest. Here is an example response:
{
"code": "SUCCESS",
"message": "OK",
"data": {
"score": 7
},
"extra": null,
"transactionId": "196eb0c777789e58",
"pricingStrategy": "PAY"
}
The score reflects how frequently the phone number is topped up. A higher score indicates a more reliable or active user.
5. Best Practices for Using the API
- Ensure the phone numbers are properly formatted, with the correct country and area codes.
- Implement retries for requests in case of network or timeout errors.
- Store the
transactionIdfor auditing or debugging purposes.
Conclusion
By following these steps, you can successfully integrate the Telecom Score API into your system for better fraud detection and user scoring.
Further Assistance
If you continue to experience issues despite following the guidelines provided, please contact our support team for further assistance:
- Email: help@advance.ai
- Submit a Ticket: Via ADVANCE.AI Support
Comments
0 comments