# Purchase SMS

To buy SMS, you need to keep in mind which option and social network you want to request the number, you can see the options and social networks available here (opens new window).

  • Host: https://api.contasinfinity.com.br/api/v1/sms/purchase
  • Method HTTP: POST
  • Params:
    • option: Opção 3
    • social_network: Twitter
  • Headers:
    • Accept: application/json
    • Authorization: Bearer YOUR_API_KEY

# Response: 201

{
    "message": "successfully created.",
    "id": 20339,
    "number": "5531983866351"
}

# Possible mistakes when buying SMS

# 1. The option parameter needs to be filled: STATUS 422

This error occurs when the option parameter is not filled.

{
    "message": "The given data was invalid.",
    "errors": {
        "option": [
            "The option field is required."
        ]
    }
}

# 2. The social network parameter needs to be filled in: STATUS 422

This error occurs when the social network parameter is not filled.

{
    "message": "The given data was invalid.",
    "errors": {
        "social_network": [
            "The social network field is required."
        ]
    }
}

# 3. Service not found: STATUS 200

This error occurs when the option or social network parameter is invalid.

{
    "message": "Service not found."
}

# 4. No Balance: STATUS 200

This error occurs when you do not have enough balance to complete the transaction.

{
    "message": "no balance."
}

# 5. Error getting number: STATUS 200

This error occurs an unknown error getting a number.

{
    "message": "Error while getting number."
}

# 6. No numbers available: STATUS 200

This error occurs when there are currently no numbers available.

{
    "message": "No numbers available."
}