{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"c8dfa85a-e7c7-4433-8c03-9e09ce3fe361","name":"Eat App Public Phone Integration API","description":"# Eat App - Phone Integration API (v2)\n\nPush incoming-call events from a PBX or phone system into Eat App. Eat App matches the caller's number against the restaurant's guest book and pops the guest profile on the screen of the staff member whose extension took the call.\n\n## Base URL\n\n| Environment | Host |\n| --- | --- |\n| Sandbox | `https://api.eat-sandbox.co` |\n| Production | `https://api.eatapp.co` |\n\nSet `{{host}}` in your Postman environment. The collection defaults to the sandbox.\n\n## Authentication\n\nNone. These webhooks are unauthenticated. The `restaurant_id` that Eat gives you acts as the shared secret, so treat it as one and always call over HTTPS.\n\n## Endpoints\n\n| Method | Path | Purpose |\n| --- | --- | --- |\n| `GET` or `POST` | `/services/phones/v2/webhooks` | Log an incoming call |\n| `POST` | `/services/phones/v2/webhooks/status` | Update the status of that call |\n\nAll parameters go in the **query string**, on both `GET` and `POST`. No request body is read.\n\n`POST` is preferred over `GET` because the numbers stay out of proxy and browser logs. Note that `/webhooks/status` accepts `POST` only.\n\n## Call statuses\n\nEvery logged call carries one of three statuses:\n\n| Status | Meaning | Set by |\n| --- | --- | --- |\n| `incoming` | The phone is ringing, nobody has picked up yet. | Internal only. A PBX cannot set this. |\n| `answered` | A staff member took the call. | `/webhooks` sets this automatically. |\n| `missed` | Nobody took the call. | `POST /webhooks/status` with `status=missed` |\n\nOnly `answered` and `missed` are accepted by `/webhooks/status`. Anything else returns `phone_log.status_not_valid`.\n\n## Expected flow\n\n1. A call comes in. Your PBX calls `/services/phones/v2/webhooks`. Eat App creates a call log with status `answered` and pops the guest profile on the matching staff screen.\n2. If nobody picks up, your PBX calls `POST /services/phones/v2/webhooks/status` with `status=missed`. Eat App finds the **most recent `answered`** call for that `caller_id` plus `extension_sid` and flips it to `missed`.\n\n`/webhooks` assumes the call was answered because most PBX systems only fire their webhook once the call connects. Still call `/webhooks` first even if your PBX fires on ring, then correct the status afterwards.\n\nOnly calls currently at `answered` are eligible for an update. Updating the same call twice returns `phone_log.not_provided`.\n\n## Errors\n\nEvery error is HTTP `422 Unprocessable Content` and has this shape:\n\n```json\n{\n    \"errors\": [\n        {\n            \"key\": \"parameter_missing\",\n            \"code\": \"parameter_missing\",\n            \"detail\": \"param is missing or the value is empty or invalid: caller_id missing\"\n        }\n    ]\n}\n```\n\n| `code` | Cause |\n| --- | --- |\n| `parameter_missing` | A required parameter is missing, blank, or does not resolve. Read `detail` to see which one. |\n| `phone_log.status_not_valid` | `status` is not `answered` or `missed`. |\n| `phone_log.not_provided` | No `answered` call found for that `caller_id` plus `extension_sid`. |\n\nSuccess is HTTP `200 OK` with an empty body.\n\n## Testing\n\nEverything in this collection works against the sandbox. A `200` means your integration is wired up correctly, so you can move on to testing at the restaurant.\n\n## Guide\n\n[Phone integration guide](https://restaurant.eatapp.co/knowledge/phone-integration-guide-1)","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"6372626","collectionId":"c8dfa85a-e7c7-4433-8c03-9e09ce3fe361","publishedId":"SW7Z599a","public":true,"publicUrl":"https://documenter-api.postman.tech/view/6372626/SW7Z599a","privateUrl":"https://go.postman.co/documentation/6372626-c8dfa85a-e7c7-4433-8c03-9e09ce3fe361","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"light","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.12.7","publishDate":"2023-08-29T09:22:38.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"Bonsai Sandbox","id":"06500289-f0a8-499c-ac5b-eb9f8a028f3b","owner":"10495480","values":[{"key":"host","value":"https://api.eat-sandbox.co","enabled":true},{"key":"key","value":"key","enabled":true,"type":"default"},{"key":"token","value":"abc","enabled":true},{"key":"partner_email","value":"support@partner.com","enabled":true},{"key":"partner_password","value":"your_password","enabled":true},{"key":"restaurant_id","value":"RESTAURANT_UUID","enabled":true},{"key":"restaurant_email","value":"support@restaurant.com","enabled":true},{"key":"restaurant_password","value":"your_password","enabled":true},{"key":"group_id","value":"GUEST_UUID","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/493b3c2ed8a797bf8b8565bd4a712bebbc301a5367ca4797a4cba3905172d667","favicon":""},"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":"Bonsai Sandbox","value":"10495480-06500289-f0a8-499c-ac5b-eb9f8a028f3b"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/SW7Z599a"}