Streetdata: REST API Migration Guide
The Streetdata HTTPS interface (msg.php, twpro.php, twadv.php, cred.php and log.php) is being switched off. To keep sending and receiving messages, you'll need to update your integration to use our REST API.
This guide only covers what changes. For full details on every endpoint and field, see the REST API documentation.
Before you start
- You need new API credentials. Your current Streetdata user ID and password will not work with the REST API.
- Your system must support TLS 1.2 at minimum. We recommend TLS 1.3. Older systems may fail to connect, usually with a generic connection or handshake error.
- Requests use JSON. You send an HTTPS POST with a JSON body instead of URL or form parameters.
Step 1: Create your REST API key
Everyone migrating must do this, even if you already have API credentials.
- Log in at https://app.sinch.com.
- Go to Settings → API Settings.
- In the Basic Authentication section, click Create new key.
- Copy your API key and API secret straight away and store them somewhere safe. The secret is only shown once, when the key is created. If you lose it, you'll need to create a new key.
Don't use the Create new key button under Legacy API Credentials. Those credentials only work with the old Streetdata API.
Send your key and secret in an HTTP Basic Authorization header on every request. The value is your key and secret joined by a colon, then Base64-encoded:
Authorization: Basic base64(API_KEY:API_SECRET)
Check it works: replace API_KEY and API_SECRET with your own, then run the request below. It only reads data, so no messages are sent.
curl https://au.app.api.sinch.com/v1/delivery_reports \ -u "API_KEY:API_SECRET" \ -H "Accept: application/json"
A 200 response means your key works (the list may be empty). A 401 means the key or secret is wrong.
Step 2: Update your API calls
What's different
| Streetdata API | REST API | |
|---|---|---|
| Address | https://www.streetdata.com.au/admin/msg.php |
https://au.app.api.sinch.com/v1/messages |
| Request | GET or POST with parameters | POST with a JSON body |
| Credentials |
u and p parameters |
HTTP Basic Authorization header |
| Phone numbers | 0412000001 |
E.164 international format, e.g. +61412000001
|
| Multiple recipients | Comma-separated in d
|
One message per recipient in the messages array, up to 100 per request |
| Scheduling |
s, a Unix epoch timestamp |
scheduled, an ISO 8601 date and time in UTC, e.g. 2027-03-01T23:15:00.000Z
|
| Response | Plain text, e.g. OK 507357
|
JSON, with a message_id (UUID) for each message |
The tables below only show the fields you need to change. For every field and its limits, see Send messages.
Sending an SMS (msg.php)
Before:
https://www.streetdata.com.au/admin/msg.php?u=7357&p=secret&d=0412000001&m=Hello%20world
After:
POST https://au.app.api.sinch.com/v1/messages
Authorization: Basic <base64(API_KEY:API_SECRET)>
Content-Type: application/json
{
"messages": [
{
"content": "Hello world",
"destination_number": "+61412000001"
}
]
}Sending a scheduled SMS with delivery reports
Before:
https://www.streetdata.com.au/admin/msg.php?u=7357&p=secret&d=0412000001&m=Hello%20world&s=1803942900&mf=3
After:
POST https://au.app.api.sinch.com/v1/messages
Authorization: Basic <base64(API_KEY:API_SECRET)>
Content-Type: application/json
{
"messages": [
{
"content": "Hello world",
"destination_number": "+61412000001",
"delivery_report": true,
"scheduled": "2027-03-01T23:15:00.000Z"
}
]
}| Old parameter | New field |
|---|---|
u, p
|
Authorization header |
d |
destination_number, in E.164 format. One message per recipient |
m |
content |
o |
source_number. Optional: leave it out to send from your account's default number |
s (Unix epoch) |
scheduled: the same time as an ISO 8601 date and time in UTC. For example, 1803942900 becomes 2027-03-01T23:15:00.000Z
|
mf |
Not needed. Long messages are split automatically, with no limit on the number of parts and no truncation. If you used mf to limit cost, check message length in your own code |
Long messages and special characters now behave differently.
-
Long messages: Streetdata cut messages off at 160 characters unless you used
mfto allow more parts. The REST API sends the whole message, and you're billed for every part. -
Special characters: Streetdata replaced characters such as emoji and curly quotes with a
?. The REST API sends them as written, as Unicode, which costs more.
Check your message text and length before you switch.
Responses and errors
| Streetdata response | REST API response |
|---|---|
OK with a job number |
202, with a message_id for each message (one per recipient). Save these in place of the Streetdata job number |
ERROR (message not accepted) |
400 with a JSON error. The whole request is rejected, so check your numbers before sending. The error shows which message failed: for example, /messages/1/destination_number means the second message, because counting starts at 0. A wrong API key or secret returns 401
|
FATAL (service unavailable) |
A 5xx server error. Try again later |
For example error responses, see Send messages.
Receiving replies (twpro.php / twadv.php)
If you download incoming messages by calling twpro.php or twadv.php, we recommend switching to a webhook (see Step 3). Replies are then sent to your system as they arrive, so you don't need to keep asking for them.
If you need to keep collecting replies yourself, call GET /v1/replies, then confirm the ones you've processed with POST /v1/replies/confirmed. Confirming replaces the Streetdata "last read" pointer (l): confirmed replies aren't returned again. See Replies for details.
Checking on your messages (log.php)
log.php returned a list of the messages you'd sent, with a delivery status for each. The REST API has no single call that does exactly the same. Which option to use depends on what you need:
-
One message: call
GET /v1/messages/{message_id}, using themessage_idreturned when you sent it. - Status changes as they happen: use delivery reports (see Step 3).
-
A list of the messages you've sent: use a detail report. It won't match
log.phpexactly.
For example, to get one message:
curl https://au.app.api.sinch.com/v1/messages/MESSAGE_ID \ -u "API_KEY:API_SECRET" \ -H "Accept: application/json"
The response includes the message's current status. A message can be retrieved for 45 days. See Get message status for details.
Checking your balance (cred.php)
cred.php returned your remaining credits. The REST API has a balance check.
Call GET /v1/credits_management/account to get your remaining credits. You can also see your balance in the web app at https://app.sinch.com.
curl https://au.app.api.sinch.com/v1/credits_management/account \ -u "API_KEY:API_SECRET" \ -H "Accept: application/json"
The response looks like this:
{
"remaining_credits": {
"MT_MMS": 20,
"MT_SMS": 1024
},
"related_account": "VendorName:RelatedAccountName",
"expiry": "2018-01-12T12:12:12.122Z"
}-
MT_SMSandMT_MMSare your remaining SMS and MMS credits. A balance is left out if one hasn't been set. - The balance check only works for prepaid accounts. Other accounts get a
404.
See Get credit balance for details.
Step 3: Delivery reports and replies
Streetdata didn't have webhooks or delivery reports. You checked on your messages by calling log.php, and collected replies by calling twpro.php. Delivery reports and webhooks are new with the REST API.
Delivery reports
To get delivery reports for messages sent through the REST API, add "delivery_report": true to each message. Then either:
- Use a webhook (recommended). Webhooks send delivery reports and replies to your system as they happen, and can be formatted to suit whatever your system expects. Create one under Settings → API Settings → Webhooks. See Webhooks Management for the options.
-
Collect them yourself. Call
GET /v1/delivery_reports, which returns up to 100 at a time, then confirm the ones you've processed withPOST /v1/delivery_reports/confirmed. See Delivery Reports.
Replies
We recommend a webhook, set up the same way. If you keep collecting replies yourself, see Receiving replies in Step 2.
Checklist
- New key created under Basic Authentication, and the secret saved
- System supports TLS 1.2 at minimum (TLS 1.3 recommended)
- Phone numbers in E.164 format (
+61…) - Numbers checked before sending
- No more than 100 messages per request
- Unix epoch schedule times (
s) changed to ISO 8601 UTCscheduledtimes - Long messages and special characters checked: they are no longer cut off at 160 characters or replaced with
?, and cost more -
delivery_report: trueadded if you use delivery reports - Your code reads JSON responses instead of
OK/ERROR/FATALtext - Replies received by webhook, or
twpro.php/twadv.phpcalls replaced withGET /v1/replies - Anything that calls
cred.phporlog.phpreplaced (see Checking on your messages and Checking your balance)
Using an AI coding assistant
Our documentation has a version made for AI tools such as Claude, ChatGPT or Cursor. See AI Integration in the REST API documentation. You could start with a prompt like:
Update my code to stop using the Streetdata HTTPS interface (msg.php with u, p, d, m, o, s, mf parameters and OK/ERROR/FATAL text responses) and use the Sinch REST API instead (POST https://au.app.api.sinch.com/v1/messages, HTTP Basic authentication, JSON). Use the documentation at https://developers.app.sinch.com/llms.txt. Convert phone numbers to E.164 format, convert the Unix epoch schedule time to an ISO 8601 UTC scheduled time, and send no more than 100 messages per request.
FAQs
I already have Streetdata API credentials. Do I still need a new key?
Yes. Credentials listed under Legacy API Credentials only work with the old Streetdata API and will stop working when it's switched off.
Can I keep sending my details in the URL?
No. The REST API only accepts POST requests with a JSON body, and your credentials go in the Authorization header rather than the URL.
I used mf to control costs. What should I do?
The REST API splits long messages automatically and doesn't cap or truncate them. Check the length of your message in your own code before sending.
I never set mf. Does anything change for me?
Yes. Messages over 160 characters were cut off at 160. The REST API sends the whole message and you're billed for every part, so check the length of your messages before you switch.
Do I get one ID per send or one per recipient?
One per recipient. Streetdata returned a single job number for each send. The REST API returns a message_id for every message, which you use to match delivery reports and replies.