{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"0446705c-6c89-4489-ad5c-787d5eb3ca92","name":"CLOUDWORK|PRO Sandbox API","description":"The CLOUDWORK|PRO Sandbox API is organized around REST. Most of our endpoints handle payloads and responses in `JSON` format, however, some of the endpoints that require sending documents work with `form-data` payloads.\n\n# Authentication\n\nIn order to access to our Public API you will need to follow these steps:\n\n1. Request access to the Public API from customer success ([support@cloudworkpro.com](https://mailto:support@cloudworkpro.com)) or your sales agent ([sales@cloudworkpro.com](https://mailto:sales@cloudworkpro.com)).\n    \n2. Once enabled, you will be able to access your Public API credentials from this link [https://staging-app.cloudworkpro.com/my_company/public_api](https://staging-app.cloudworkpro.com/my_company/public_api)  \n    **NOTE**: This link is only accessible by the account owner.\n    \n3. Once you have your API credentials, you will be able to use the [https://staging-cwp-api.cloudworkpro.com/auth/token](https://staging-cwp-api.cloudworkpro.com/auth/token) endpoint and request a token that will allow you to use the Public API.\n    \n\n# Errors\n\nCWP uses conventional HTTP response codes to indicate the success or failure of an API request.\n\n| **HTTP Code** | **Description** |\n| --- | --- |\n| 200 - OK | Everything worked correctly |\n| 401 - Unauthorized | You're not sending the bearer token or the token is expired. |\n| 403 - Forbidden | Your token doesn't have the permissions to perform the request. |\n| 404 - Not Found | The resource you requested doesn't exist |\n| 422 - Unprocessible Entity | This error message indicates that the request's Content-Type header was not set correctly. |\n| 429 - Too Many Request | Too many request to our API. We recommend to use an exponential backoff when you're trying to do many requests to a specific endpoint. |\n| 500 - Internal Server Error | Something went wrong on CWP's end. (Please contact tech support if this is the case) |\n| 502 - Bad Gateway | Something went wrong on CWP's end. (Please contact tech support if this is the case) |\n| 503 - Service Unavailable | Something went wrong on CWP's end. (Please contact tech support if this is the case) |\n| 504 - Gateway Timeout | Something went wrong on CWP's end. (Please contact tech support if this is the case) |\n\nHowever, most `400 Bad Request Errors` are handled in a different way. You will receive a 200 HTTP status code with an error code 400 in the response and an error that will explain what issue occurred.\n\n### OK Example - 200 - OK\n\n``` json\n{\n    \"code\": 200,\n    \"reason\": \"\",\n    \"data\": \"Status updated successfully to: 'draft' for work order with ID: 633cf3e1bb4e2453a0497b65\",\n    \"success\": true\n}\n\n ```\n\n### Error Example - 200 - OK\n\n``` json\n{\n    \"error\": {\n        \"code\": \"WO_0005\",\n        \"message\": \"The work types provided were not found in CWP platform\",\n        \"detail\": \"This error happens when you send work type IDs that do not exists in CWP platform\"\n    },\n    \"code\": 400,\n    \"reason\": \"The work types provided were not found in CWP platform\",\n    \"data\": {},\n    \"success\": true\n}\n\n ```\n\n# Expanding Responses\n\nThe API has a feature to expand the response of the GET endpoints.\n\nIn a normal scenario you will get a response similar to this:\n\n``` json\n{\n    \"code\": 200,\n    \"reason\": \"\",\n    \"data\": {\n      ...,\n      \"work_type_ids\": [\"636953eebf54aa00087e75ee\"]\n      ...\n    },\n    \"success\": true\n}\n\n ```\n\nHowever, if you send the query param `summary` with the value `full` you will get a response similar to this:\n\n``` json\n{\n    \"code\": 200,\n    \"reason\": \"\",\n    \"data\": {\n      ...,\n      \"work_type_ids\": [\"636953eebf54aa00087e75ee\"],\n      \"work_types\": [\n         {\n            \"_id\": \"636953eebf54aa00087e75ee\",\n            \"name\":\"WiFi Heat Mapping\",\n            \"description\":\"WiFi Heat Mapping\"\n         }\n      ],\n      ...\n    },\n    \"success\": true\n}\n\n ```\n\nThe endpoints that currently have the feature are:\n\n\\* `GET /workorders/:id`\n\n# Pagination\n\nAll list endpoints in our platform use cursor based pagination. These endpoints share a common structure in their response as detailed below:\n\n``` json\n{\n    \"code\": number,\n    \"reason\": string,\n    \"error?\": {\n        \"code\": string,\n        \"message\": string,\n        \"detail\": string\n    },\n    \"data\": [],\n    \"pagination\": {\n        \"hasNext\": boolean,\n        \"hasPrev\": boolean,\n        \"nextCursor\": string,\n        \"prevCursor\": string,\n        \"pageResults\": number,\n        \"totalResults\": number\n    },\n    \"options\": {\n        \"limit\": number,\n        \"sortBy?\": {\n            \"field\": string,\n            \"value\": string\n        },\n        \"filterBy?\": [\n            {\n                \"field\": string,\n                \"value\": string\n            },\n            {...},\n            {...}\n        ]\n    },\n    \"success\": boolean\n}\n\n ```\n\n### Response\n\nThe next table explains all the attributes of the pagination object.\n\n### Parameters\n\n| **Name** | **Description** | **Example** |\n| --- | --- | --- |\n| hasNext `boolean` | Indicate if next page exists. | `true` |\n| hasPrev `boolean` | Indicate if previous page exists. | `false` |\n| nextCursor `string` | Cursor to move to the next page if it exists. | `next_X2lkfDYzMWFkZGM5M2M5YTgwMGIwYTQxMTM5OXwtMeKVoQ==` |\n| prevCursor `string` | Cursor to move to the prev page if it exists. | `prev_X2lkfDYzMWFkZGM5M2M5YTgwMGIwYTQxMTM5OXwtMeKVoQ==` |\n| pageResults `number` | Indicate the number of items returned in the response. | `10` |\n| totalResults `number` | Indicate the total items the platform has based on the filters you send. | `100` |\n\n#### Query\n\n| **Name** | **Required** | **Description** | **Default** | **Example** |\n| --- | --- | --- | --- | --- |\n| cursor `string` | `optional` | The cursor to move between pages. |  | `next_X2lkfDYzMWFkZGM5M2M5YTgwMGIwYTQxMTM5OXwtMeKVoQ==` |\n| limit `number` | `optional` | The number of items per page that you want to return. | `100` | `10` |\n| sortBy `string` | `optional` | The attribute that you want to choose to sort the data.  <br>  <br>The shape is column: value  <br>  <br>**Valid values:** \\[asc, desc\\]  <br>  <br>**Note:** In this version of the API pagination only supports sorting one column |  | `name:desc` |\n| filterBy `object` | `optional` | Attributes that you want to filter by their value.  <br>  <br>You can send multiple attributes.  <br>  <br>**Note:** This value should be URL encoded |  | `{ \"name\": \"IoT Devices\" }` |\n| filterOperator `string` | `optional` | The boolean operator that you want to use to filter the data.  <br>  <br>Valid values: \\[and, or\\] | `and` | `or` |\n| in `string` | `optional` | In operator to filter an attribute by multiple values.  <br>  <br>You can send as many `in` operators as you want.  <br>  <br>**Note:** This value should be URL encoded |  | `column_name![value1, value2, ..., valueN]` |\n| between `string` | `optional` | Between operator to filter data between two values.  <br>  <br>You can send as many `between` operators as you want.  <br>  <br>This filter will take into account only the first two array elements.  <br>  <br>**Note:** This value should be URL encoded |  | column_name!\\[start_value, end_value\\] |\n\n# Webhooks\n\nA webhook listener is a server that listens at a specific URL for incoming HTTP POST notification messages that are triggered when events occur.\n\nAll webhook notifications are delivered by CWP from two possible IPs:\n\n\\* 44.193.241.109  \n\\* 184.169.231.134\n\nIf you do not allowlist the above IPs, you **will not** receive webhook notifications.\n\nUpon receipt of a webhook notification, your webhook listener application must return an HTTP response with a `200 OK status`. If you do not, CWP will attempt to resend the webhook multiple times.\n\nCWP will deliver webhook notifications to the webhook listener application at the URL you specify in your webhook settings. In order to set up webhook URLs you should do the following:\n\n1. In your company settings you should go to the webhooks settings.\n    \n2. You must add at least one URL. Remember, this URL should be a POST endpoint and it must return a `200 OK status`\n    \n3. You should activate all the events that you want to receive.\n    \n\n### Integration\n\n#### Basic Authentication\n\nCWP supports [Basic Authentication](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication#The_general_HTTP_authentication_framework) when delivering webhook notifications to your webhook endpoint. If you opt to include Basic Authentication in your webhook endpoint, you will be asked to provide the Basic Authentication username and password for your Staging and Production listeners to CWP during onboarding. All webhook notifications are transported over SSL which provides an end-to-end encryption channel.\n\n#### Webhook Delivery\n\nOnce you receive a webhook notification message, you can use use the updated information to carry custom activities for your specific requirements, for example:\n\n\\* Store the updated status in a database  \n\\* Retrieve an object from an API\n\nA delivery attempt of a webhook notification is made to the listener after subscribed events occur in the system. In the event of a delivery failure, Cloudwork|PRO will attempt to resend a notification every **n \\* 10** minutes, where **n = the number of the retry attempt**. A maximum of 5 retries are attempted.\n\nFor example, if the notification was originally attempted at 4:00 PM:\n\n| **Attempt** | **Attemped after (mins)** | **Attempted delivery (time)** |\n| --- | --- | --- |\n| On Event | 00 | 4:00 PM |\n| 01 | 10 | 4:10 PM |\n| 02 | 20 | 4:30 PM |\n| 03 | 30 | 5:00 PM |\n| 04 | 40 | 5:40 PM |\n| 05 | 50 | 6:30 PM |\n\n\\* _Approximate time - may not be exact_\n\nCWP retains notification records for up to 3 months per event. Attempting to retrieve a webhook message that is older than 3 months results in a `404 Not Found` response.\n\nIn order to get the most out of your webhook notifications, it is important to be aware of the following:\n\n\\* CWP typically delivers webhooks as soon as the event happens, however, there can be delays. Also, sometimes your system could fail when is receiving the webhook. You can make use of the CWP API webhooks endpoints to get missing webhooks.  \n\\* CWP does not guarantee that webhooks will be sent in the order in which they are generated. CWP advises that you make use of the `created_date` timestamp included in the webhook notification object to handle the ordering of events.\n\n### Webhook Events\n\nFor now, we have the following webhook events:\n\n\\* `WORKORDER.CREATE`  \n\\* `WORKORDER.CREATE`  \n\\* `SITE.CREATE`\n\n# SDKs\n\nWe are currently working on SDKs that will help make the things easier for you :).\n\n# CLOUDWORK|PRO Sandbox API\n\n---","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"14637006","team":1593587,"collectionId":"0446705c-6c89-4489-ad5c-787d5eb3ca92","publishedId":"2s93m62hh9","public":true,"publicUrl":"https://staging-api-docs.cloudworkpro.com","privateUrl":"https://go.postman.co/documentation/14637006-0446705c-6c89-4489-ad5c-787d5eb3ca92","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"documentationLayout":"classic-double-column","customisation":{"metaTags":[{"name":"description","value":""},{"name":"title","value":""}],"appearance":{"default":"system_default","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-02-20T15:17:04.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"PUBLIC_STAGING","id":"b2d08bfd-65ba-4fed-8bc1-654e8863bd15","owner":"15830235","values":[{"key":"DOMAIN","value":"staging-cwp-api.cloudworkpro.com","enabled":true,"type":"default"},{"key":"API_KEY","value":"YOUR_API_KEY","enabled":true,"type":"secret"},{"key":"APP_URL","value":"staging-app.cloudworkpro.com","enabled":true,"type":"default"},{"key":"CLIENT_SECRET","value":"YOUR_CLIENT_SECRET","enabled":true,"type":"default"},{"key":"CLIENT_ID","value":"YOUR_CLIENT_ID","enabled":true,"type":"default"},{"key":"SECRET_ID","value":"YOUR_SECRET_ID","enabled":true,"type":"default"},{"key":"TOKEN","value":"YOUR_TOKEN","enabled":true,"type":"default"},{"key":"RESOURCE_ID","value":"RESOURCE_ID","enabled":true,"type":"default"},{"key":"RESOURCE_NAME","value":"work_order_extra_photos","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/8f359077482fb0099584276a82c859b50b606c157e54557f0f1f990839d1b35c","favicon":"https://cloudworkpro.com/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":"PUBLIC_STAGING","value":"15830235-b2d08bfd-65ba-4fed-8bc1-654e8863bd15"}],"canonicalUrl":"https://staging-api-docs.cloudworkpro.com/view/metadata/2s93m62hh9"}