{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"26c7eb83-3738-43c5-889f-bef45346c9d8","name":"Smshosting REST API EN","description":"<img src=\"https://smshosting.s3.eu-west-3.amazonaws.com/cover-progetto.jpg\">\n\nThanks 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    \n- send email campaigns\n    \n- search and show the details of sent sms\n    \n- search and visualize the sms received with the reception service\n    \n- display your Smshosting.it profile data\n    \n- manage contacts and groups of the address book\n    \n- manage Fidelity Cards\n    \n- manage coupons\n    \n\n## Before you begin\n\nIf you haven't already done so, [register to Smshosting.it](https://cloud.smshosting.it/sms/signupInit.ic) for free.\n\n## Services base URL\n\nThe base URL to use to access the REST API is the following\n\n`https://api.smshosting.it/rest/api`\n\nor, for resellers\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 [Smshosting.it](https://www.smshosting.it). Visit the [API security management](https://cloud.smshosting.it/sms/user/securityApiInit.ic) 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.smshosting.it/rest/api/user`\n\nor by running from Linux shell the command\n\n`curl --user AUTH_KEY:AUTH_SECRET https://api.smshosting.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\n[Smshosting.it](https://www.smshosting.it) 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.smshosting.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.smshosting.it/rest/api/user`\n\n# Deprecation of TLS 1.0 and 1.1\n\nWe want to inform you that, in order to guarantee the highest security standards, **we will no longer support TLS 1.0 and TLS 1.1 cryptography protocols since the 31st of March 2023** allowing the access using only **TLS 1.2 or higher**.\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    \n- `204` - Request completed successfully. Deleted Resource.\n    \n- `400` - Missing parameter\n    \n- `401` - Authentication failed\n    \n- `404` - Resource not found\n    \n- `405` - HTTP method not allowed\n    \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    \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    \n- page 2 - `offset=20&limit=20`\n    \n- page 3 - `offset=40&limit=20`\n    \n- page 4 - `offset=60&limit=20`\n    \n- page 5 - `offset=80&limit=20`\n    \n\n# Libraries\n\n## Java\n\nIt allows you to integrate our services into your _Java_ projects, adding the ability to send SMS, Email, manage customers and much more.  \n[View Sources](https://github.com/smshosting/smshosting-api-java-client)\n\n## PHP\n\nIntegrate Smshosting functionality into your PHP project.  \n[View Sources](https://github.com/smshosting/smshosting-api-php-client)\n\n## C#\n\nC# library that allows you to integrate Smshosting in your projects: SMS, Email, customers management and much more. You can find it on [Github](https://github.com/smshosting/smshosting-api-cs-client) or [NuGet](https://www.nuget.org/packages?q=smshosting)","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":true,"owner":"1793341","team":609386,"collectionId":"26c7eb83-3738-43c5-889f-bef45346c9d8","publishedId":"UV5XhcrB","public":true,"publicUrl":"https://apidoc-en.smshosting.it","privateUrl":"https://go.postman.co/documentation/1793341-26c7eb83-3738-43c5-889f-bef45346c9d8","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"documentationLayout":"classic-double-column","customisation":null,"version":"8.10.1","publishDate":"2021-10-19T09:42:35.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"SMSH_EMPTY","id":"f91559a6-36d7-96e8-b753-2a54cb37f4be","owner":"1793341","values":[{"key":"auth_key","value":"GET from Smshosting","enabled":true},{"key":"auth_secret","value":"GET from Smshosting","enabled":true},{"key":"BaseUrl","value":"https://api.smshosting.it","enabled":true},{"key":"header_accept_value","value":"application/json","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://smshosting.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":"SMSH_EMPTY","value":"1793341-f91559a6-36d7-96e8-b753-2a54cb37f4be"}],"canonicalUrl":"https://apidoc-en.smshosting.it/view/metadata/UV5XhcrB"}