Skip to main content

Conversion Tracking API

The Conversion Tracking API is used to help enterprises accurately measure the actual conversion performance of OTP (One‑Time Password) SMS messages on the user side. Because international SMS delivery receipts are often affected by multiple factors such as Operator regulations and regional compliance, making accurate tracking difficult, enterprises can use this API to report in real-time whether a user has successfully converted (e.g., successful login or verification). This allows PaaSoo to better assist you in tracking SMS quality, optimizing communication channels, and enhancing the user experience.

1. Invocation Method

Invocation Method
  • HTTP Method: POST
  • Content-Type: application/json
  • Request URL: https://api.paasoo.com/conversion

2. Use Cases and Importance

After sending an OTP SMS to a user, international SMS delivery receipts often experience delays or inaccuracies. Enterprises can use this API to proactively inform PaaSoo of the actual verification result of the user's subsequent actions (for example, if the user entered the correct verification code within a specified time, it indicates the SMS was successfully converted). This helps to:

  • Assist in Quality Management: By combining the user's actual verification actions, it helps judge the actual performance across different countries/regions, Operators, or Carrier routes;
  • Cost Optimization: Identify Carrier routes with a low Conversion Rate and make timely adjustments to reduce overall costs;
  • Win-win Cooperation: PaaSoo can continuously optimize SMS sending quality and user experience based on actual conversion results.

3. Request Example

cURL
curl -X POST "https://api.paasoo.com/conversion" \ 
-H "Content-Type: application/json" \
-d '{ "key": "Abcdefgh", "secret": "Abc123EF", "messageid": "015bd4-d6dfa7-58w", "conversionTime": "2022-02-22T01:00:01.000Z", "conversion": 1 }'

Where:

  • Content-Type must be application/json
  • The request body is in JSON format, containing the required fields for this API.

4. Request Parameters

ParameterTypeRequiredDescriptionExample
keystringYesAPI Key (composed of 8 alphanumeric characters), used to uniquely identify your account. Can be obtained in the PaaSoo client console.Abcdefgh
secretstringYesAPI Secret (composed of 8 alphanumeric characters), used in conjunction with key for authentication. Can be obtained in the PaaSoo client console.Abc123EF
messageidstringYesMessage ID, the unique identifier for each SMS record. Enterprises can obtain this ID via the SMS API.00018f-e4bf51-e002
conversionTimestringNoConversion time, using the ISO8601 standard format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z') in the UTC+0 timezone.
Defaults to the UTC time when the API request reaches the server.
2022-02-22T01:00:01.000Z
conversionintegerYesThe conversion status of the message:
  • 0 - Conversion failed;
  • 1 - Conversion successful
1

Important Notes:

  • The conversion time must use the correct UTC timezone format, otherwise the system may experience a time discrepancy.
  • Since this API authenticates via key and secret, please make sure to call it from your server side and keep the credentials secure to avoid exposing them on the frontend.
  • If you cannot accurately capture the user's action time, you can choose not to pass conversionTime, and the system will automatically record it as the UTC time when the server received the request.

5. Response Parameters

After the conversion tracking request is submitted, the system will return a corresponding status code to confirm whether the request was successfully received and processed.

ParameterTypeDescriptionExample
statusstringResponse status. The status code submitted to the PaaSoo cloud communication platform.
  • 0 - success: Success
  • 2 - Missing parameters: Required parameters are missing
  • 3 - Invalid parameters: Parameter format error
  • 4 - Invalid credentials: API Key or API Secret error
  • 11 - System error: System error
"0"
status_detailsstringStatus description, used to explain the error reason or detailed information.Missing parameters

Below are common response examples:

5.1 Success Example

{ "status": "0", "status_details": "success"}

5.2 Failure Example

{ "status": "2", "status_details": "Missing parameters."}

6. Common Errors and Troubleshooting

  • 2 - Missing parameters: Check if key, secret, messageid, or other required fields are missing.
  • 3 - Invalid parameters: Parameter format error, such as conversion not being an integer, or the time format not complying with ISO8601.
  • 4 - Invalid credentials: API Key or API Secret do not match, please verify the correctness of your credentials.
  • 11 - System error: Internal server error, such as server processing exceptions or failure to parse the request. If this occurs multiple times, please contact technical support.

7. Code Examples

The following examples show how to call this API using common programming languages:

import requests

# API Endpoint
url = "https://api.paasoo.com/conversion"

# Request Payload
payload = {
"key": "API_KEY", # Replace with your API Key
"secret": "API_SECRET", # Replace with your API Secret
"messageid": "015bd4-d6dfa7-58w", # Message ID from the SMS API
"conversionTime": "2022-02-22T01:00:01.000Z", # Optional: UTC time in ISO8601 format
"conversion": 1 # 1 for success, 0 for failure
}

# Request Headers
headers = {
"Content-Type": "application/json"
}

try:
# Send HTTP POST request
response = requests.post(url, json=payload, headers=headers)
response.raise_for_status()

# Parse and print JSON response
data = response.json()
if data.get("status") == "0":
print("Conversion reported successfully:", data.get("status_details"))
else:
print(f"Report failed, status: {data.get('status')}, details: {data.get('status_details')}")

except requests.exceptions.RequestException as e:
print(f"Request failed: {e}")

Note: The parameters in the above code are examples and should be replaced with your actual parameter values.

Any language or framework that supports HTTP/HTTPS and can send JSON formatted requests can easily integrate with this API. Simply submit the corresponding parameters using the same request method (POST + Content-Type: application/json).


8. Best Practices and Notes

  1. Security Management:
    • Never expose your API Key and API Secret on the client side (e.g., frontend browsers, frontend logic of mobile Apps); please call the API from your backend server.
  2. Data Validity:
    • Ensure the messageid matches the ID returned when the SMS was sent, in order to accurately establish the conversion association.
  3. Time Format:
    • Try to use the ISO8601 standard time format and ensure it is in the UTC+0 timezone.
  4. Accuracy and Timeliness:
    • If your system can only report after a certain period following a user's success or failure, you can record the local time and pass it as conversionTime. The more timely the report, the more helpful it is for SMS quality analysis.
  5. Batch Updates:
    • If you need to report massive amounts of conversion information in a high-concurrency environment, please reasonably plan the API invocation frequency and negotiate with PaaSoo to see if additional bandwidth or higher concurrency capabilities are needed.

9. FAQ

What if I cannot get the exact time of the user's action?
  • You can choose not to pass the conversionTime field, and the system will use the time the request arrives as the conversion time.
If I have a large number of conversion records to report at once, will it cause a timeout?
  • It is recommended to schedule them in batches to ensure network and server stability. If large-scale concurrency support is required, you can contact PaaSoo to negotiate a solution.
After reporting the conversion, how will PaaSoo process this data?
  • PaaSoo will aggregate and analyze this data to help you optimize SMS communication channels and costs, and may also include it in statistical reports.
Can conversion include more statuses?
  • Currently, it only distinguishes between success (1) and failure (0). If you have more detailed requirements, you can communicate with the PaaSoo support team.
How do I associate it with the messageid in the SMS API?
  • As long as the messageid is identical to the ID returned by the SMS API, a one-to-one association is completed. Please securely store the messageid from the response when sending the SMS.
Support

If you encounter any technical issues or have business inquiries during the API integration, please do not hesitate to contact our Support team at support@paasoo.com. We are always here to assist you.