{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"2fe01721-f02d-4de2-8702-7918a1a4f278","name":"Messaging Service API V2","description":"This page will help you get started with integrating to our API.\n\nThis document will provide instructions on how to quickly send Internet SMS, Whatsapp SMS and Mobile SMS by using HTTP application programming interface (HTTP API). The HTTP API can be used for sending SMS messages, making Number Context (number validation) requests and more.\n\nAPI is based on REST standards, enabling you to use your application/tool to access all URLs in this documentation. In order to interact with our API, any HTTP client in any programming language can be used.\n\n# Base URL\n\nSubmit all requests to the base URL. All the requests are submitted thorough HTTP POST method.\n\n```\nhttps://messaging-service.co.tz\n\n ```\n\n# Content-Type & Accept header\n\nAPI supports JSON and Accept criteria that should be specified in the header. If the Content-Type is not specified you will receive a General error. Depending on which Accept type chosen in the deader for the request, the same one will be applied in the response.\n\n- Content-Type: `application/json`\n    \n- Accept header: `application/json`\n    \n\n# Authorization\n\n- _Bearer Authentication (__**Recommended**__)_\n    \n\nWe support bearer authentication using token-based method used in API requests. You should include a Bearer Token in the Authorization header. Your token if found in **Customer Info** (Top Menu Right) -> **Customization** (Tab) -> **API Keys** (Tab) when you log in your dashboard. All examples in this documentation will base on this authentication method.\n\nThe authorization method and a space, like this: `\"Bearer \"`, are put before the token.\n\n**EXAMPLE**\n\nAuthorization: `Bearer YOUR_ACCESS_TOKEN`\n\n- _Basic Authentication_\n    \n\nWe support basic authorization using a username and password with Base64 encoding variation RFC2045-MIME.\n\n1. Username and password are combined into a string **username:password**.\n    \n2. The resulting string is encoded using the RFC2045-MIME variant of Base64.\n    \n3. The authorization method and a space, like this: `\"Basic \"`, are put before the encoded string.\n    \n\n**EXAMPLE**\n\nUsername: Aladdin\n\nPassword: open sesame\n\nBase64 encoded string: `QWxhZGRpbjpvcGVuIHNlc2FtZQ==`\n\nAuthorization: `Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==`\n\n[Gerenate your Base64 encoded string here](https://www.debugbear.com/basic-auth-header-generator)\n\n# Response status and error codes\n\nWhile using our API you may encounter certain status and error codes that you need to understand or troubleshoot. This page contains a list of all codes with thorough descriptions and action steps you need to take in case you are looking for a resolution of the problem.\n\n# HTTP status codes\n\nEvery HTTP transaction has a status code sent back by the server to define how the server handled the transaction. Most common statuses you may have encountered are `200 OK` and `404 Not Found`\n\n[Learn more about HTTP status codes here](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes)\n\n# API Status codes\n\nBesides standard HTTP status code, status object may be returned as part of the API response message, delivery report or message log.\n\nStatus json object example (Sent message):\n\n```\n{  \n   \"groupId\": 18,\n   \"groupName\": \"PENDING\",\n   \"id\": 51,\n   \"name\": \"ENROUTE (SENT)\",\n   \"description\": \"Message sent to next instance\"\n}\n\n ```\n\nGeneral status codes\n\nPENDING (group id: 18) - general status codes\n\nMessage has been processed , sent to the next instance and acknowledged by the next instance i.e. mobile network operator.\n\n| Id | Status |\n| --- | --- |\n| 50 | **PENDING_WAITING_DELIVERY** - Message has been processed and sent to the next instance i.e. mobile operator with request acknowledgment from their platform. Delivery report has not yet been received, and is awaited thus the status is still pending. |\n| 51 | **ENROUTE (SENT)** - Message has been processed, sent to the next instance and acknowledged by next instance i.e. mobile network operator, whatsapp server, android SIM. |\n| 52 | **ACCEPTED** - Message has been accepted and processed, and is ready to be sent to the next instance i.e. mobile network operator, whatsapp server, android SIM |\n| 88 | **PENDING_DISPATCHED** - Message has been processed, and sent to the next instance i.e. mobile network operator, whatsapp server, android SIM |\n\nDELIVERY (group id: 20) - general status codes\n\nDelivery report received from mobile operators.\n\n| Id | Status |\n| --- | --- |\n| 73 | **DELIVERED** - The message was successfully delivered. |\n| 74 | **EXPIRED -**  <br>1\\. The SMS was delivered and othe perators' system returned incorrect status.  <br>2\\. The SMSC was unable to deliver the message in a specified amount of time, such as when the phone was turned off. |\n| 75 | **DELETED** - The message was deleted. |\n| 76 | **UNDELIVERABLE** -  <br>1\\. The SMS was delivered and othe perators' system returned incorrect status.  <br>2\\. The SMS was unable to deliver the message.For instance, when the number does not exist. This status is also returned when SMSC does not send accurate status. |\n| 77 | **ACCEPTED** - The SMS was accepted and will be send. |\n| 78 | **UNKNOWN** - Unknown error occured. |\n| 79 | **REJECTED** - The message was rejected.The provider could have blocked phonenumbers in this range. |\n| 80 | **SKIPPED** - The message was skipped and not sent due to other reasons including operators' downtime. |\n| 108 | **READ** - The message has been read (This only applies to whatsapp). |\n| 109 | **SENT** - The message has been sent. |\n\nFAILED (group id: 22) - general status codes\n\nMessage has not been processed , failed with one of the following table.\n\n| Id | Status |\n| --- | --- |\n| 57 | FAILED_NOT_ENOUGH_CREDITS - Message has failed due to lack of credits. |\n| 58 | FAILED_SENDER - Sender Address Not Registered On Network. |\n\nREJECTED (group id: 19) - general status codes\n\nMessage has been received, but has either been rejected by our system, or the operator has reverted Rejected as final status.\n\n| Id | Status |\n| --- | --- |\n| 53 | **REJECTED_NETWORK** - Message has been received, but the network is either out of our coverage or not setup on your account. Your account manager can inform you on the coverage status or setup the network in question. |\n| 54 | **REJECTED_PREFIX_MISSING** - Message has been received, but has been rejected as the number is not recognized due to either incorrect number prefix or number length. This information is different for each network and is regularly updated. |\n| 55 | **REJECTED_DND** - Message has been received, and rejected due to the user being subscribed to DND (Do Not Disturb) services, disabling any service traffic to their number. |\n| 56 | **REJECTED_SOURCE** - Your account is set to accept only registered sender ID-s while the sender ID defined in the request has not been registered on your account. |\n| 57 | **REJECTED_NOT_ENOUGH_CREDITS** - Your account is out of credits for further submission - please top up your account. For further assistance in topping up or applying for online account topup service you may contact your account manager. |\n| 59 | **REJECTED_DESTINATION** - The destination number has been blacklisted either at the operator request or on your account - please contact Support for more information. |\n| 60 | **REJECTED_PREPAID_PACKAGE_EXPIRED** - Account credits have been expired past their validity period - please topup your subaccount with credits to extend the validity period. |\n| 61 | **REJECTED_DESTINATION_NOT_REGISTERED** - Your account has been setup for submission only to a single number for testing purposes - kindly contact your manager to remove the limitation. |\n| 62 | **REJECTED_ROUTE_NOT_AVAILABLE** - Mesage has been received on the system, however your account has not been setup to send messages i.e. no routes on your account are available for further submission. Your account manager will be able to setup your account based on your preference. |\n| 63 | **REJECTED_FLOODING_FILTER** - Message has been rejected due to a anti-flooding mechanism. By default, a single number can only receive 20 varied messages and 6 identical messages per hour. If there is a requirement, the limitation can be extended per account on request to your account manager. |\n| 64 | **REJECTED_SYSTEM_ERROR** - The request has been rejected due to an expected system system error, please retry submission or contact our technical support team for more details. |\n| 65 | **REJECTED_DUPLICATE_MESSAGE_ID** -The request has been rejected due to a duplicate message ID specified in the submit request, while message ID-s should be a unique value |\n| 66 | **REJECTED_INVALID_UDH** - Message has been received, while our system detected the message was formatted incorrectly because of either an invalid ESM class parameter (fully featured binary message API method) or an inaccurate amount of characters when using esmclass:64 (UDH). For more information feel free to visit the below articles or contact our Support team for clarification. [https://en.wikipedia.org/wiki/User_Data_Header](https://en.wikipedia.org/wiki/User_Data_Header), [https://en.wikipedia.org/wiki/Concatenated_SMS](https://en.wikipedia.org/wiki/Concatenated_SMS) |\n| 67 | **REJECTED_MESSAGE_TOO_LONG** - Message has been received, but the total message length is more than 25 parts or message text which exceeds 4000 bytes as per our system limitation. |\n| 68 | **MISSING_TO** - The request has been received, however the \"to\" parameter has not been set or it is empty, i.e. there must be valid recipients to send the message. |\n| 69 | **REJECTED_INVALID_DESTINATION** - The request has been received, however the destination is invalid - the number prefix is not correct as it does not match a valid number prefix by any mobile operator. Number length is also taken into consideration in verifying number number validity. |\n| 110 | **REJECTED_EXCEEDED_MESSAGE_LIMIT** - Number of messages sent withing specified period of time has exceeded the accepted limit. |\n| 111 | **REJECTED_MISSING_OUTLET** - Message can not be dispatched. If it is Whatsapp SMS, there is no active whatsapp account and template registered. If it is Mobile SMS, there is no active gateway account and mobile sim card registered. |\n\n# Test Mode\n\nYou can make a request just to test our API for your development environment, and get responses and understanding them. This feature will send you only dummy data generate from your request. No charges are involved in testing mode, it is free and your current sms balance will not be reducted for the requests you send to the test APIs.\n\n**TEST APIs url**\n\n**For single message text request:**\n\n_Internet SMS:_\n\n**POST** [<code>https://messaging-service.co.tz/api/sms/v2/test/text/single</code>](#send-sms)\n\n_Whatsapp SMS:_\n\n**POST** [<code>https://messaging-service.co.tz/api/whatsapp/v2/test/text/single</code>](#send-sms)\n\n_Mobile SMS:_\n\n**POST** [<code>https://messaging-service.co.tz/api/mobile/v2/test/text/single</code>](#send-sms)\n\n**For multiple messages text request:**\n\n_Internet SMS:_\n\n**POST** [<code>https://messaging-service.co.tz/api/sms/v2/test/text/multi</code>](#send-sms)\n\n_Mobile SMS:_\n\n**POST** [<code>https://messaging-service.co.tz/api/mobile/v2/test/text/multi</code>](#send-sms)\n\nFurther instructions are on [Send SMS](#send-sms) Section","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"1679195","team":510420,"collectionId":"2fe01721-f02d-4de2-8702-7918a1a4f278","publishedId":"2sAYkDP1XN","public":true,"publicUrl":"https://documenter-api.postman.tech/view/1679195/2sAYkDP1XN","privateUrl":"https://go.postman.co/documentation/1679195-2fe01721-f02d-4de2-8702-7918a1a4f278","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"dark","themes":[{"name":"dark","logo":null,"colors":{"top-bar":"212121","right-sidebar":"303030","highlight":"FF6C37"}},{"name":"light","logo":null,"colors":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"}}]}},"version":"8.10.1","publishDate":"2025-03-18T13:50:53.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"Cloud API","id":"a7e442b5-efb4-4186-883a-9622c41aafea","owner":"1679195","values":[{"key":"baseUrl","value":"https://messaging-service.co.tz","enabled":true,"type":"default"},{"key":"token","value":"d983d9d1d54176047e68547aba079ba4","enabled":true,"type":"default"}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/6c4988b48b101ea628d277d971425e0263ad7113ce880d696e2040209b78b7de","favicon":"https://res.cloudinary.com/postman/image/upload/v1590998404/team/zhtapi4cqdggbwxfimkz.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Cloud API","value":"1679195-a7e442b5-efb4-4186-883a-9622c41aafea"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/2sAYkDP1XN"}