API Endpoint: Get Number
Request Method: Post/GET
URL: https://pvahub.io/api/sms
Parameters:
- auth-token: Your API key. This is required for authentication.
- app: The name of the application for which you want to get the Number. In this case, it's 'google'.
- country: Any valid alpha-2 or alpha_3 country code for which you want to get the Number, or our custom value "RA" for a random country. In this case, it's 'UK'.
CURL Example:
GET /?auth-token={your-api-key}&app=google&country=uk
Response
The response is a JSON object with the following properties:
- meta: This is the HTTP status code of the response. A 200 status code means the request was successful.
- data: This is an object that contains the following properties:
- sid: This is a unique identifier for the Number.
- did: This is the phone number that received the Number.
Response Example:
{
"meta":200
"data":{
"sid":"ef97ae2c-5b19-474f-972a-2a3f1d7cac4b",
"did":"+447937744740"
}
}
This endpoint is used to retrieve an Number for a specific application. You need to provide your API key for authentication and specify the application name in the request. The response includes a unique identifier for the Number and the phone number that received the Number.
API Endpoint: Get Otp
Request Method: Post/GET
URL: https://pvahub.io/api/sms/otp
Parameters:
- auth-token: Your API key. This is required for authentication.
- sid: The SID received with the phone number.
CURL Example:
GET /?auth-token={your-api-key}&sid=ef97ae2c-5b19-474f-972a-2a3f1d7cac4b
Response
The response is a JSON object with the following properties:
- meta: This is the HTTP status code of the response. A 200 status code means the request was successful.
- data: This is an object that contains the following properties:
- sid: This is a unique identifier for the Number.
- did: This is the phone number we are trying to get OTP on.
- otp: This is the OTP.
- status: This the status of the OTP, this could be either 'Success' or 'Pending' and expected only if meta is 200.
Response Example:
{
"meta":200
"data":{
"sid":"ef97ae2c-5b19-474f-972a-2a3f1d7cac4b",
"did":"+447937744740"
"otp":"Your example OTP is 12345"
"status":"Success"
}
}
This endpoint is used to retrieve an OTP recieved by a specific number. You need to provide your API key for authentication and specify the number's identifier number (SID) in the request. The response includes the that received by the Number.
Set Postback URL
This Optional API endpoint allows you to receive postback requests with dynamic values for specific tokens. so you don't have to request Get OTP endpoint. The tokens `{sid}` and `{otp}` will be dynamically replaced with the actual ID and OTP values when the postback request is made.
URL Format
The format of the postback URL is as follows:
curl -X GET \
"https://yourexample.com/api-endpoint/" \
-d "yourparameter1={sid}&yourparameter2={otp}"
URL Components:
- yourexample.com: Replace this with your specific domain.
- api-endpoint: Replace this with the appropriate endpoint on your server where you want to receive the postback request.
- yourparameter1: Replace this with the name of the parameter you're using to receive the SID value.
- yourparameter2: Replace this with the name of the parameter you're using to receive the OTP value.
Note: This is also the place to include any security tokens or additional parameters that your platform necessitates.
Example
Here is an example of how the postback URL might look after replacing the placeholders with actual values:
https://mydomain.com/receive-postback?sid=1234-abcd&otp=your+otp+is+secret
In this example, `mydomain.com` is your domain, `receive-postback` is your endpoint, `sid` is the parameter for the SID value, and `otp` is the parameter for the OTP value.
API Endpoint: Send Feedback Duplicate
Request Method: Post/GET
URL: https://pvahub.io/api/sms
Parameters:
- auth-token: Your API key. This is required for authentication.
- sid: Actual ID returned with phone number.
CURL Example:
GET feedback-duplicate/?auth-token={your-api-key}&sid={sid-returned-with-phone-number}
Response
The response is a JSON object with the following properties:
- meta: This is the HTTP status code of the response. A 200 status code means the request was successful.
- data: This is an object that contains the following properties:
- sid: This is a unique identifier for the Number.
- status: This is the message if request was success or not.
Response Example:
{
"meta":200
"data":{
"sid":"ef97ae2c-5b19-474f-972a-2a3f1d7cac4b",
"status":"Success"
}
}
This endpoint is used to send a feedback for a specific number. You need to provide your API key for authentication and specify the ID in the request. The response includes either Success Or failed warning.
API Endpoint: Send Feedback Timeout
Request Method: Post/GET
URL: https://pvahub.io/api/sms
Parameters:
- auth-token: Your API key. This is required for authentication.
- sid: Actual ID returned with phone number.
CURL Example:
GET feedback-timeout/?auth-token={your-api-key}&sid={sid-returned-with-phone-number}
Response
The response is a JSON object with the following properties:
- meta: This is the HTTP status code of the response. A 200 status code means the request was successful.
- data: This is an object that contains the following properties:
- sid: This is a unique identifier for the Number.
- status: This is the message if request was success or failed due to early request.
Response Example:
{
"meta":200
"data":{
"sid":"ef97ae2c-5b19-474f-972a-2a3f1d7cac4b",
"status":"Success"
}
}
This endpoint is used to send a feedback for a specific number. You need to provide your API key for authentication and specify the ID in the request. The response includes either Success Or Early request warning.
Errors
If there is an issue with your request to "api/sms/" endpoint, you will receive an HTTP error response code along with a message indicating the nature of the error. Some common error codes and their meanings include:
- 400 Bad Request: Your request was malformed or missing required parameters.
- 401 Unauthorized: You are not authorized to access the requested resource.
- 403 Forbidden: Your request was valid, but you are not permitted to access the requested resource.
- 404 Not Found: The requested resource could not be found.
- 429 Too Many Requests: Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
- 500, 502, 503, 504 - Server Errors: Something went wrong on pvahub's end. (These are rare.)