Skip to content

API for developers: where to start

Updated:

On this page

An API is the way your own program “clicks” in SMS Portal|app for you. Instead of typing a number in the dashboard, your program sends a short request, and the message leaves your Android phone, from your own SIM card.

The first call

  1. In the dashboard open the API Keys section and click “Generate API Key”. Copy the key straight away: you will not see it again.
  2. Make sure a phone with the app is connected.
  3. Send a POST request to https://smsportal.app/api/v1/gateway/send-sms. Put the key in the x-api-key header, and in the body send JSON with a list of numbers (recipients) and the text (message).
sh
curl -X POST https://smsportal.app/api/v1/gateway/send-sms \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"recipients": ["+48123456789"], "message": "Test from the API"}'

Replace the key and the number with your own. Give the number in full format with the country code.

Where the rest is

  • API docs. At /api-docs/ there is a full list of endpoints: single and bulk sending, the list of phones, message history, statistics and webhooks. Every endpoint has a description and examples.
  • Guide in the dashboard. Under Messaging → API you will find a short guide with ready examples.
  • Receiving replies. To let your program get SMS from customers, use webhooks.

Look after the key

An API key works like a password for sending from your account. Do not paste it into code that goes to a public repository. If you suspect a leak, revoke the key in the dashboard and generate a new one. More in the article about API keys.

What next

Questions and answers

Where do I get an API key?
In the dashboard, in the API Keys section. After you generate it the key is shown only once, so copy it straight away and store it somewhere safe.
Does an API response mean the SMS was delivered?
No. The response only says the message was accepted for sending. Check the real status in the dashboard history or receive it through a webhook.

Didn’t find the answer? Contact us

Send your first SMS today

Create a free account, connect your phone and see how customers respond to messages from your number.