Dine SMS sendes fra din egen mobil.Se, hvordan det virker
PLATFORMAPI-first architectureSecure device pairingDelivery visibilityMulti-device controlVersioned documentation
Developer hub/ WhatsApp API

WA · 9 dokumenterede operationer

WhatsApp API documentation

Send WhatsApp messages and media, retry failures, verify recipient numbers and securely retrieve received messages after an explicit synchronization request.

Connected phones synchronizing conversations and media
REST base URLhttps://api.smsmobileapi.com

JSON responses · HTTPS required · UTF-8

Connect your API key

Connect once, then test endpoints across SMS, calls, notifications, WhatsApp and email.

Start here

Your first request in four steps

1

Connect and enable WhatsApp for a supported mobile.

2

Confirm the recipient with the number-check endpoint.

3

Send with waonly=yes.

4

To retrieve received messages: activate collection, call /getwa/synchronisation/, wait for recovery, then call /getwa.

MANDATORY BEFORE RETRIEVING RECEIVED MESSAGES

Request WhatsApp synchronization first.

Before calling /getwa to view received WhatsApp messages, you must request a synchronization window through https://api.smsmobileapi.com/getwa/synchronisation/. This explicit step is required to securely authorize the exchange between WhatsApp and SMSMobileAPI. Wait for recovery, then call /getwa.

Open the required synchronization endpoint →

WEBHOOK V2 TIL DENNE API

Abonner kun på de mobilhændelser, dit workflow har brug for.

5 hændelsestyper

En destination kan modtage alt, eller du kan adskille produktionssystemer, analytics og operationelle advarsler. Hver hændelse har et præcist navn, så din applikation kan håndtere den forudsigeligt.

whatsapp.submitted

WhatsApp indsendt

Et afsendelsesjob for WhatsApp blev oprettet.

whatsapp.sent

WhatsApp sendt

Det tilsluttede WhatsApp-miljø bekræftede, at beskeden blev sendt.

whatsapp.failed

WhatsApp fejlede

Afsendelse af WhatsApp fejlede.

whatsapp.received

WhatsApp modtaget

En WhatsApp-besked blev hentet, efter kontoen anmodede om synkronisering.

whatsapp.voice.transcribed

Talebesked transskriberet

En berettiget hentet WhatsApp-talebesked blev konverteret til anvendelig tekst.

Authentication

Keep credentials on your server

Use apikey for direct integrations. OAuth2 client credentials are available for server-side applications; request a token and send it as Authorization: Bearer ACCESS_TOKEN.

Historiestyring

Ryd historik sikkert: preview, slette, følg fremskridt

Disse endepunkter rydder den valgte serverhistorik for din API nøgle, ikke beskeder på telefoner eller eksterne tjenester. De leverer ikke kontoudslettelse. Ny aktivitet kan forekomme efter sletning.

Læs request_id og prøv igen
Integrationsbeskyttelse

Som standard forbliver linkede eller behandlede optegnelser synlige. Kun til brug include_linked=1 hvis du accepterer, at integration eller igangværende behandling kan stoppe med at virke.

Hvordan virker request_id

  1. Vis forhåndsvisning af tællingerne med action=previewNej. request_id er nødvendige, og ingen optegnelser er slettet.
  2. Generér en unik request_id for en ny sletning, for eksempel en UUID. Gem det før du sender action=delete.
  3. til genforsøg, timeouts eller HTTP 202, genbrug det samme API nøgletal, historikendepunkt, request_id og include_linked værdi. Opret aldrig et nyt ID automatisk efter en fejl.
  4. Hvornår completed=true, operationen er færdig. Genbrug af sin ID giver det samme resultat i stedet for at slette nyligt ankommet optegnelser. Brug kun et nyt ID til en bevidst ny oprydning.

request_id identificerer din sletning operation, ikke en individuel SMS. Tilladt format: 16-128 ASCII bogstaver, tal, bindestreger eller underpointsum. A UUID genereres med crypto.randomic UID () er egnet.

Sletningen sker i portioner. Ved HTTP 202 med continue_required=true skal action=delete gentages efter 3 sekunder. Der kører intet cron-job i baggrunden. action=status læser kun fremdriften og fortsætter ikke sletningen, heller ikke ved HTTP 200.

Eksempler på sletning og status

Udskift prøven request_id med din egen unikke værdi før start. Følgende slette anmodninger ændre real konto historie; de er ikke previews.

POST · API - tasten
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
POST · OAuth2
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  -H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
GET · status
curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=status" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"

GET accepterer også action=preview eller action=delete. POST anbefales: URL-parametre kan lække ind i browserens historik og serverlogfiler. Placer aldrig en sletning URL i et offentligt link, billede eller pre-hentning.

For POST, send alle parametre i formularen organ eller et JSON objekt, aldrig i forespørgselsstrengen. Ukendt parametre afvises; dato eller mobile filtre understøttes ikke.

Godkendelse af historikendepunkter

Anvendelse apikey eller Authorization: Bearer adgangskort udstedt af SMSMobileAPI OAuth2. Send ikke en genfriskning eller en API nøgle som en Bearer - En token. Udløb tokens er nægtet.

Når der er sat en række områder, history:read tillader forhåndsvisning / status og history:delete giver også mulighed for sletning. Begrænsninger på både token og OAuth klienten ansøge. Legacy tokens uden scope bevarer deres eksisterende konto adgang.

OAuth2 vælger den unikke primære API - nøgle. Hvis flere primære nøgler findes, også give apikey til at vælge en tilhørende kontoen. Sekundære nøgler giver aldrig adgang til den primære nøglehistorie.

Læs svaret før du fortsætter

count_delete er det kumulative antal, der er fjernet ved denne operation. selected_at_start er den oprindelige udvælgelse protected_at_start antal udelukkede registreringer. Anvendelse preview.linked_or_processing til at tælle tilknyttede poster, selv når include_linked=1.

JSON · HTTP 202
{
    "result": {
        "error": 0,
        "history": "whatsapp-sent",
        "action": "delete",
        "request_id": "6d54ac58-41f1-4fbc-9a39-6e6c86089451",
        "status": "processing",
        "completed": false,
        "count_delete": 100,
        "total_before": 250,
        "selected_at_start": 200,
        "protected_at_start": 50,
        "include_linked": 0,
        "continue_required": true,
        "message": "Repeat GET or POST with the same request_id and include_linked to continue. Status requests do not run deletion."
    }
}
  • 200 med completed=true: færdig. En 200 preview eller status respons alene beviser ikke afslutning.
  • 400 INVALID_REQUEST_ID: Kontroller formatet. 404 REQUEST_NOT_FOUND: der findes ingen operation for dette id API Nøgle og historie.
  • 401: ugyldige eller udløbne legitimationsoplysninger. 403: utilstrækkelig OAuth omfang eller uautoriseret konto.
  • 409 HISTORY_BUSY: en anden oprydning kører; fortsætte det fra den oprindelige klient. 409 INCLUDE_LINKED_CONFLICT: gendannelse af originalen include_linked værdi.
  • 409 OAUTH_ACCOUNT_AMBIGUOUS: giv en API-nøgle, der tilhører denne konto.
  • 503 eller afbrydelse af nettet: nogle partier kan allerede være færdige. Kontrollér konfiguration, og prøv derefter igen med originalen request_id. Opret ikke en udskiftning operation automatisk.
POST · GET

Send a WhatsApp message

#
ENDPOINThttps://api.smsmobileapi.com/sendsms

Sends a WhatsApp text or supported media through the connected environment.

When to use it

Use it for individual recipients or a dashboard contact group.

Parameters

NavnTypeRequirementDescription
apikey string Required Your API key; omit when using a Bearer token.
recipients phone Required Country code plus number, without + or 00.
message string Required Text body; multiple lines are supported.
waonly yes Required Must be yes to request WhatsApp-only delivery.
url_media HTTPS URL Valgfrit Public PDF, document, archive or JPG/PNG URL.
url_media_shorted yes Valgfrit Use a shortened download URL with PDF preview mode.
pdf_with_image yes Valgfrit Add an image preview for a PDF.
encrypt_message yes Valgfrit Require recipient-side decryption.
contactGroup GUID Valgfrit Send to every contact in a dashboard group.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/sendsms?waonly=yes" \
  -d "apikey=YOUR_API_KEY" \
  -d "recipients=191728660" \
  --data-urlencode "message=Your order is ready."

Example response

JSON
{
  "result": {
    "error": 0,
    "sent": "1",
    "id": "MESSAGE_GUID",
    "send_with_whatsapp": "1"
  }
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Supported media URLs must be public HTTPS resources.
  • WhatsApp formatting: *bold*, _italic_, ~strikethrough~ and triple-backtick monospace.
POST · GET

Resend an unsent WhatsApp message

#
ENDPOINThttps://api.smsmobileapi.com/resendwa/

Retries a WhatsApp message that currently has an error status.

When to use it

Use it after diagnosing a failed WhatsApp log entry.

Parameters

NavnTypeRequirementDescription
apikey string Required Your API key.
guid string Required GUID of the failed message.

Request example

cURL
curl "https://api.smsmobileapi.com/resendwa/?apikey=YOUR_API_KEY&guid=MESSAGE_GUID"

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Only failed messages are eligible for resend.
GET

Activate inbound retrieval

#
ENDPOINThttps://api.smsmobileapi.com/getwa/active/

Activates, deactivates or toggles WhatsApp message retrieval.

When to use it

Activate collection first. Then, before retrieving received messages, you must request synchronization through /getwa/synchronisation/.

Parameters

NavnTypeRequirementDescription
apikey string Required Your API key.
statut 0 | 1 | x Valgfrit 1 activates, 0 deactivates, x or omission toggles the current state.

Request example

cURL
curl "https://api.smsmobileapi.com/getwa/active/?apikey=YOUR_API_KEY&statut=1"

Example response

JSON
{
  "success": true,
  "read_message_active": 1,
  "status_note": "Activated"
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Inbound retrieval is disabled by default for privacy.
  • Activation alone does not retrieve messages: a synchronization request remains mandatory before using /getwa for newly received activity.
GET

Required: request WhatsApp synchronization

#
ENDPOINThttps://api.smsmobileapi.com/getwa/synchronisation/

Mandatory security step before retrieving received WhatsApp messages. It opens a time-limited synchronization window.

When to use it

You must call this endpoint before /getwa whenever you need SMSMobileAPI to check WhatsApp for newly received messages. Wait for recovery, then call /getwa.

Parameters

NavnTypeRequirementDescription
apikey string Required Your API key.

Request example

cURL
curl "https://api.smsmobileapi.com/getwa/synchronisation/?apikey=YOUR_API_KEY"

Example response

JSON
{
  "error": "0",
  "messages": "synchronized",
  "expire_at": "2026-03-11 12:27:00",
  "expire_at_unix": "1773232020"
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Synchronization is for receiving messages only. Do not call it before sending.
  • The response returns expire_at and expire_at_unix. Request another synchronization window when you need to collect newer received messages.
  • A synchronization request is mandatory to protect the exchange between WhatsApp and SMSMobileAPI.
GET

Retrieve WhatsApp messages

#
ENDPOINThttps://api.smsmobileapi.com/getwa

Returns received WhatsApp messages that were recovered during a requested synchronization window.

When to use it

Mandatory prerequisite: activate inbound retrieval, call https://api.smsmobileapi.com/getwa/synchronisation/ first, wait for recovery, then call this endpoint. /getwa does not itself start synchronization.

Parameters

NavnTypeRequirementDescription
apikey string Required Your API key.
before Unix timestamp Valgfrit Return records before this timestamp.
date YYYY-MM-DD Valgfrit Return records for one date.
message_type text | audio Valgfrit Filter text messages or audio messages converted to text; omit for both.

Request example

cURL
curl "https://api.smsmobileapi.com/getwa/?apikey=YOUR_API_KEY&message_type=text"

Example response

JSON
{
  "date": "2026-03-11",
  "hour": "12:27:00",
  "timestamp": "1773232020",
  "number": "19176728660",
  "contact": "SMSMobileAPI",
  "message": "When will I receive my order?",
  "guid": "652fcfc0-12a8-46f5-b5ba-9391135b8b4c"
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
GET

Check a WhatsApp number

#
ENDPOINThttps://api.smsmobileapi.com/whatsapp/checknumber/

Checks whether a phone number is available on WhatsApp.

When to use it

Use it before sending to reduce avoidable failures.

Parameters

NavnTypeRequirementDescription
apikey string Required Your API key.
recipients phone Required Country code plus number, without + or 00.

Request example

cURL
curl "https://api.smsmobileapi.com/whatsapp/checknumber/?apikey=YOUR_API_KEY&recipients=19176728660"

Example response

JSON
{
  "contact_found_on_whatsapp": "yes",
  "recipients": "19176728660"
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
POST

Create an OAuth2 access token

#
ENDPOINThttps://api.smsmobileapi.com/oauth2/token

Exchanges client credentials for a Bearer token.

When to use it

Use it for server-to-server integrations where short-lived credentials are preferred.

Parameters

NavnTypeRequirementDescription
grant_type string Required Must be client_credentials.
client_id string Required Client ID from the dashboard.
client_secret string Required Client secret from the dashboard.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/oauth2/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=client_credentials" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Keep the client secret on your server. Never include it in mobile or browser code.
POST · GET

Ryd historikken for sendte WhatsApp-beskeder

#
ENDPOINThttps://api.smsmobileapi.com/delete-history-whatsapp-sent/

Rydder serveroptegnelser for sendt WhatsApp beskeder. Det sletter ikke breve fra WhatsApp samtaler.

When to use it

Brug preview først, kontrollere tællingerne, derefter udtrykkeligt anmode om sletning. Dette fjerner hele den valgte historik for API nøgle, uden dato, telefon eller besked filtre.

Parameters

NavnTypeRequirementDescription
apikey string Valgfrit Krævet uden OAuth2. Med OAuth2 vælges en API-nøgle, der tilhører samme konto.
action preview | delete | status Valgfrit preview tæller uden at slette; delete starter eller fortsætter sletningen; status viser kun fremdriften. API’en bruger som standard delete; denne tester bruger preview.
include_linked 0 | 1 Valgfrit Standard 0: hold forbundne eller behandle optegnelser. Sæt 1 til at inkludere dem, med en risiko for at bryde integreringer. Hold denne værdi uændret, når du fortsætter en sletning.
request_id string Valgfrit Påkrævet til delete og status, valgfrit til preview. Brug 16–128 ASCII-bogstaver, cifre, bindestreger (-) eller understregninger (_). Opret ét unikt ID for hver ny sletning, og behold det ved alle gentagelser. Det er hverken et besked-ID eller en API-nøgle.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=preview" -d "include_linked=0"
Eksempler på sletning og status

Udskift prøven request_id med din egen unikke værdi før start. Følgende slette anmodninger ændre real konto historie; de er ikke previews.

POST · API - tasten
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
POST · OAuth2
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  -H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
GET · status
curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-sent/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=status" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"

Example response

JSON
{
    "result": {
        "error": 0,
        "history": "whatsapp-sent",
        "action": "preview",
        "total": 120,
        "simple": 100,
        "linked_or_processing": 20,
        "selected": 100,
        "include_linked": 0,
        "operation_in_progress": false,
        "active_include_linked": null
    }
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Eksemplet ovenfor er en forhåndsvisning, ikke en sletning. Tællinger er illustrative; den endelige markering er fast, når sletning starter.
  • include_linked=1 kan forstyrre GHL, Zapier, automatiseringer, afmeld links eller leveringssporing. Det aldrig forbigår konto ejerskab eller opbevaring integritet kontrol.
POST · GET

Ryd historikken for modtagne WhatsApp-beskeder

#
ENDPOINThttps://api.smsmobileapi.com/delete-history-whatsapp-received/

Rydder serveroptegnelser for modtaget WhatsApp beskeder. Den afbryder ikke forbindelsen WhatsApp eller slette samtaler.

When to use it

Brug preview først, kontrollere tællingerne, derefter udtrykkeligt anmode om sletning. Dette fjerner hele den valgte historik for API nøgle, uden dato, telefon eller besked filtre.

Parameters

NavnTypeRequirementDescription
apikey string Valgfrit Krævet uden OAuth2. Med OAuth2 vælges en API-nøgle, der tilhører samme konto.
action preview | delete | status Valgfrit preview tæller uden at slette; delete starter eller fortsætter sletningen; status viser kun fremdriften. API’en bruger som standard delete; denne tester bruger preview.
include_linked 0 | 1 Valgfrit Standard 0: hold forbundne eller behandle optegnelser. Sæt 1 til at inkludere dem, med en risiko for at bryde integreringer. Hold denne værdi uændret, når du fortsætter en sletning.
request_id string Valgfrit Påkrævet til delete og status, valgfrit til preview. Brug 16–128 ASCII-bogstaver, cifre, bindestreger (-) eller understregninger (_). Opret ét unikt ID for hver ny sletning, og behold det ved alle gentagelser. Det er hverken et besked-ID eller en API-nøgle.

Request example

cURL
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=preview" -d "include_linked=0"
Eksempler på sletning og status

Udskift prøven request_id med din egen unikke værdi før start. Følgende slette anmodninger ændre real konto historie; de er ikke previews.

POST · API - tasten
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
POST · OAuth2
curl -X POST "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
  -H "Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN" \
  -d "action=delete" -d "include_linked=0" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"
GET · status
curl -G "https://api.smsmobileapi.com/delete-history-whatsapp-received/" \
  --data-urlencode "apikey=YOUR_API_KEY" \
  -d "action=status" \
  -d "request_id=6d54ac58-41f1-4fbc-9a39-6e6c86089451"

Example response

JSON
{
    "result": {
        "error": 0,
        "history": "whatsapp-received",
        "action": "preview",
        "total": 120,
        "simple": 100,
        "linked_or_processing": 20,
        "selected": 100,
        "include_linked": 0,
        "operation_in_progress": false,
        "active_include_linked": null
    }
}

Want to run this request? Connect your API key at the top of the page to unlock the interactive tester.

Connect key ↑
Good to know
  • Eksemplet ovenfor er en forhåndsvisning, ikke en sletning. Tællinger er illustrative; den endelige markering er fast, når sletning starter.
  • include_linked=1 kan forstyrre GHL, Zapier, automatiseringer, afmeld links eller leveringssporing. Det aldrig forbigår konto ejerskab eller opbevaring integritet kontrol.

Troubleshooting

Errors and safe retries

Read the HTTP status and the JSON error field before retrying. Do not retry validation or authentication failures without correcting the request first.

HTTPCodeWhat to do
400missing_parameterA required parameter is empty or absent. Check the parameter table for the endpoint.
403invalid_apikeyThe API key is unknown, expired or not authorized for the requested feature.
429too_many_requestsRequests are arriving too quickly. Wait, then retry with exponential backoff.
500server_errorThe service could not complete the request. Keep the response and contact support if it persists.
Retry ruleRetry only transient 429 and 5xx responses. Start after 1 second, then back off to 2, 4 and 8 seconds.

Need help?

Bring the request context—not your secrets.

Share the endpoint, timestamp, HTTP status and sanitized response. Never include API keys, tokens or private message content.

Contact API support →
The secure SMSMobileAPI mobile app connecting a phone to the web dashboard and REST API for SMS and call operations
Encrypted mobile-to-platform connection

Official mobile application

The secure bridge between your phone, dashboard and API.

SMS and call operations pass through the official SMSMobileAPI app installed on your connected phone. The app securely pairs the device with your account, synchronizes authorized events and links the mobile network to the dashboard and REST API.

1Mobile appPairs the phone and its SIM 2Encrypted linkAuthenticates and protects data in transit 3Dashboard & APIControls workflows and activity
  • Signed releases distributed through the official Google Play and Apple App Store listings
  • Google and Apple platform review, signing and distribution controls
  • Secure device pairing, HTTPS transport and authenticated API access
  • Only the permissions required for the mobile features you enable
Get the official SMSMobileAPI app on Google Play Download the official SMSMobileAPI app on the Apple App Store
Capabilities depend on the permissions and background access allowed by Android or iOS.