{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"815b4443-57d7-4552-acd4-c9315f7a92fd","name":"Smstools REST API EN","description":"Thanks to the REST API you can integrate your software with our gateway in a **simple** and **fast** way.\n\nThe REST API are based on HTTP methods so for the integration you can use an HTTP Client written in **any programming language**.\n\nThrough the REST API you can perform the following operations:\n\n- send single sms and campaigns\n- send email campaigns\n- search and show the details of sent sms\n- search and visualize the sms received with the reception service\n- display your profile data\n- manage contacts and groups of the address book\n- manage Fidelity Cards\n- manage coupons\n    \n\n\n## Services base URL\n\nThe base URL to use to access the REST API is the following\n\n`https://api.smstools.it/rest/api`\n\n---\n\n**For security reasons, REST API only allows HTTPS connections (HTTP is not supported)**.\n\n---\n\n# Make a request\n\n## Authentication\n\nAll requests to the REST API need to be authenticated using the **HTTP Basic authentication**.\n\nThe username and password to be provided are the **AUTH_KEY** and **AUTH_SECRET** codes associated to your profile on Smstools. Visit the API security management section in your private area to retrieve them.\n\nYou can test your credentials by simply calling from the **browser** the following URL:\n\n`https://AUTH_KEY:AUTH_SECRET@api.smstools.it/rest/api/user`\n\nor by running from Linux shell the command\n\n`curl --user AUTH_KEY:AUTH_SECRET https://api.smstools.it/rest/api/user`\n\nThe HTTP error 401 will be received if the authentication fails.\n\n## Econding e Content-Type\n\nAll requests to the REST API **must** be UTF-8 encoded.\n\n**HTTP POST** and **HTTP PUT** must have **Content-Type** in the header set as `application/x-www-form-urlencoded` unless otherwise indicated.\n\n## Choose the response format\n\nSmstools REST API can return information in either **JSON** (default) or **XML** format.\n\nTo get the response in the desired format use the HTTP header \"**Accept**\" in your request.\n\n- **Accept:application/json** to get a JSON\n    \n\n`curl -H \"Accept: application/json\" --user AUTH_KEY:AUTH_SECRET https://api.smstools.it/rest/api/user`\n\n- **Accept:application/xml** to get an XML\n    \n\n`curl -H \"Accept: application/xml\" --user AUTH_KEY:AUTH_SECRET https://api.smstools.it/rest/api/user`\n\n# Response handling\n\n## Response Codes (HTTP Status Code)\n\nFor each request, the REST API returns one of the following **HTTP Status Codes**:\n\n- `200` - Request completed successfully\n- `204` - Request completed successfully. Deleted Resource.\n- `400` - Missing parameter\n- `401` - Authentication failed\n- `404` - Resource not found\n- `405` - HTTP method not allowed\n- `500` - Unexpected server error\n    \n\n## Response Content\n\nFor every **HTTP GET** and **HTTP POST** request completed successfully (**HTTP status equal to 200**) the REST API returns a JSON/XML as content.\n\nIn case of a successful **HTTP PUT** and **HTTP DELETE** call (**HTTP status equal to 200 or 204**) the content of the response will be empty.\n\nIf a call terminates with an error (**HTTP status other than 200 or 204**), a JSON/XML explaining the error is returned:\n\n- `errorCode` - HTTP status code\n- `errorMsg` - Detailed error code\n    \n\nFor example, if the authentication fails the REST API will return a 401 HTTP Status Code and the following JSON as content:\n\n```\n{\n   \"errorMsg\":\"BAD_CREDENTIALS\",\n   \"errorCode\":401\n}\n\n```\n\n## Pagination\n\nSome resources (sent or received sms search, contact search, etc.) return paginated results.\n\nFor example the sent sms search returns the following JSON\n\n```\n{\n   \"metadata\":{\n      \"count\":1,\n      \"offset\":0,\n      \"limit\":20\n   },\n   \"smsList\":[\n      {\n         \"id\":389395385,\n         \"to\":\"393480000000\",\n         \"text\":\"Test Sms\",\n         \"from\":\"mrossi\",\n         \"status\":\"DELIVERED\",\n         \"insertDate\":\"2014-01-13T15:01:35+0100\",\n         \"sentDate\":\"2014-01-13T15:01:37+0100\",\n         \"deliveryDate\":\"2014-01-13T15:01:40+0100\",\n         \"transactionId\":\"72810108d4114097b9edb42b255b273c\",\n         \"price\":0.0945\n      }\n   ]\n}\n\n```\n\nThe `metadata` field contains useful information for managing the pagination of results.\n\nThe `count` property indicates the total number of results found for that search.\n\nThe `offset` and `limit` fields indicate respectively the index of the first result and the number of results returned by the call.\n\n`offset` and `limit` can be used as parameters in the request to control the range of results returned.\n\nFor example, if a search finds 100 results and the page size is 20 elements\n\n```\n{\n   \"metadata\":{\n      \"count\":100,\n      \"offset\":0,\n      \"limit\":20\n   },\n   .......\n}\n\n```\n\nit will be possible to get 5 pages using the following values of `offset` and `limit`:\n\n- page 1 - `offset=0&limit=20`\n- page 2 - `offset=20&limit=20`\n- page 3 - `offset=40&limit=20`\n- page 4 - `offset=60&limit=20`\n- page 5 - `offset=80&limit=20`","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"1793341","team":609386,"collectionId":"815b4443-57d7-4552-acd4-c9315f7a92fd","publishedId":"UVRBnSGf","public":true,"publicUrl":"https://apidoc-en.smstools.it","privateUrl":"https://go.postman.co/documentation/1793341-815b4443-57d7-4552-acd4-c9315f7a92fd","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2021-12-21T15:33:22.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"SMSTOOLS_EMPTY ","id":"24abd2a5-7ed5-4305-bbec-8cdbeb07981b","owner":"1793341","values":[{"key":"auth_key","value":"GET from website","enabled":true},{"key":"auth_secret","value":"GET from website","enabled":true},{"key":"BaseUrl","value":"https://api.smstools.it","enabled":true}],"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/885e8a15e42dbe9cb7da09c188f6e8f0de7ed87dbbba50d695b9ab4485969265","favicon":"https://smstools.it/favicon.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":"SMSTOOLS_EMPTY ","value":"1793341-24abd2a5-7ed5-4305-bbec-8cdbeb07981b"}],"canonicalUrl":"https://apidoc-en.smstools.it/view/metadata/UVRBnSGf"}