{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"c6f70661-9d77-4342-8979-af903b9b7aaa","name":"IPW Metazo API","description":"## Welcome to IPW API\n\n# Getting started\n\nThe common path to this api is:\n\n```\n/metazo/api/v1\n\n ```\n\nThe API demo calls in this documentation rely on environment variables, which can be edited when downloading the collection. Most of the variables function out of the box, but the following list of environment variables must be edited to match your specific system.\n\n- `metazoUrl`\n    \n- `testuser`\n    \n- `testpass`\n    \n- `checksumsecret`\n    \n\n## About variables and url encoding\n\nThe scope of this postman collection is to provide an insight into the structure and functionality of the API, and can be used as an introduction before building an actual implementation.  \nAs such, it is strongly adviced to move to an actual implementation as quickly as possible, and to refresh the checksum secret as soon as the move from postman to implementation is made.\n\n### Encoding\n\nPostman does not encode values in query parameters. This means that you must either 1) Only use test values that does not contain special characters or 2) Manually encode test values containing special characters (i.e. `& => &` etc...).\n\n## Response codes\n\nMetazo API will respond with the following http response codes:  \n**2xx Success**\n\n- `200 - Success`\n    \n\n**4xx Client errors**\n\n- `400 - Bad request`\n    \n- `404 - Not found`\n    \n\n**5xx Server errors**\n\n- `500 - Unexpected error`\n    \n\n# Checksums and the checksum secret\n\nAll requests (ping excluded) must include a checksum calculated from the request's parameters. This checksum is validated serverside to ensure the integrity of the client's request data.\n\n## How to calculate the checksum for query parameters using HMAC-SHA1\n\nThe checksum is calculated by these steps:\n\n1. All query and body parameters are sorted alphabetically by keys\n    \n2. Construct a string by appending the keys and values together like so: (key1 + value1 + key2 + value2 + ... ).\n    \n3. Sign that string using HMAC-SHA1 and the checksum secret. The secret is found in the Configuration section of Metazo and is available for administrators of the system.\n    \n\nThe code example below demonstrates the function using a checksum secret of `GJrSGgo0scmKvYSnX87kjSnAoSASUnh9XKXPT3X0kFwg3abK9n4Wp2tOAAkGQV1H4aFP4yYauq9MmvO2BCMwOQ==` and the following parameters\n\n- `site = 1`\n    \n- `user = demouser`\n    \n- `pass = demopass`\n    \n\nYou can test your own checksum generation function by using these test values as input. If done correctly, the function returns `4cca594a61204d3751aaf42360e2df1c61360e1f`.\n\n### Code example\n\n``` php\n    /**\n     * Generates an hmac based on the values in the $input array\n     * and the shared client / server secret\n     * @param array $input associative array\n     * @return string sha1 hmac\n     */\n    function generateChecksum($input) {\n        //initial array:    $input = ['site' => 1, 'user' => 'demouser', 'pass' => 'demopass']\n        ksort($input); //sort array alphabetically by keys\n        //after sort:       $input = ['pass' => 'demopass', 'site' => 1, 'user' => 'demouser']\n        $pairstr = '';\n        foreach($input as $key => $val) {\n            $pairstr .= $key.$val;\n        }\n        //$pairstring = \"passdemopasssite1userdemouser\"\n        $checksumsecret = \"GJrSGgo0scmKvYSnX87kjSnAoSASUnh9XKXPT3X0kFwg3abK9n4Wp2tOAAkGQV1H4aFP4yYauq9MmvO2BCMwOQ==\"; //get this from configuration menu in Metazo\n        $checksum = hash_hmac(\"SHA1\", $pairstr, $checksumsecret);\n        return $checksum; //4cca594a61204d3751aaf42360e2df1c61360e1f\n    }\n?>   \n\n ```\n\n### Finding the checksum secret\n\nThe checksum secret is auto generated by Metazo and can be found in Metazo at the API configuration menu: `Functions -> Advanced -> Site administration -> Configuration -> (tab) API`. If you need to renew the secret, tick the box **Renew Checksum Secret** and hit **Save**.\n\n**Please note:** The new checksum secret must be distributed to all clients, who needs access to the Metazo API.\n\n#### First time setup\n\nBefore using Metazo API for the first time, the secret key must be generated from the configuration page. To do this, go to the configuration page and tick the checkbox named **Renew Checksum secret**, then hit the **Save** button. This will prompt Metazo to (re)generate the secret key.\n\n## File checksums\n\n### How to calculate the file checksum for uploading files\n\nRun a `sha1` hash of the first `256` bytes of the file to upload.\n\n#### Code example\n\n``` php\n    /**\n     * Generates a checksum based on the first 256 bytes of a file\n     * @param $file Slim\\Http\\UploadFile\n     * @return string sha1 hash of the file's content\n     */\n    public function generateFileChecksum($file) {\n        $contents = file_get_contents($file->file, null, null, null, 256);\n        return hash('sha1', $contents);\n    }\n?>\n\n ```\n\n# Search operators\n\nThe following list displays the different search operators available when using [/list](#3f29d9ac-4c86-4f78-800f-b97e2419469b):\n\n| Operator |\n| --- |\n| LIKE |\n| LIKESTART |\n| LIKEEND |\n| GREATER |\n| GREATEREQUAL |\n| LESS |\n| LESSEQUAL |\n| EQUAL |\n| NOTEQUAL |\n| SOUNDSLIKE |\n| NOTSOUNDSLIKE |\n| NOTLIKE |\n| IN |\n| ISEMPTY |\n| ISTODAY |\n| BEFORETODAY |\n| AFTERTODAY |\n| DAYSAGO |\n| INDAYS |\n| LESSDAYSAGO |\n| NOTIN |\n| RLIKE |\n| FINDINSET |\n| ISNOTEMPTY |\n| INMOREDAYS |\n\n# Endpoints\n\nThe list below show the current selection of available endpoints:\n\nPlease note that in the example requests, the token query parameter is always empty to help make the examples more readable.","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"956205","team":169643,"collectionId":"c6f70661-9d77-4342-8979-af903b9b7aaa","publishedId":"RzteUDJ5","public":true,"publicUrl":"https://metazoapi.support.ipw.dk","privateUrl":"https://go.postman.co/documentation/956205-c6f70661-9d77-4342-8979-af903b9b7aaa","customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"35586E"},"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":"35586E"}}]}},"version":"8.10.1","publishDate":"2023-12-12T12:55:38.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{"title":"","description":""},"logos":{"logoLight":null,"logoDark":null}},"statusCode":200},"environments":[{"name":"IPW API v1","id":"87c58e8c-9c35-4fc2-bed8-7dfc9fdbadb3","owner":"11904435","values":[{"key":"siteid","value":"1","enabled":true},{"key":"testuser","value":"demouser","enabled":true},{"key":"testpass","value":"demopass","enabled":true},{"key":"checksumsecret","value":"GJrSGgo0scmKvYSnX87kjSnAoSASUnh9XKXPT3X0kFwg3abK9n4Wp2tOAAkGQV1H4aFP4yYauq9MmvO2BCMwOQ==","enabled":true},{"key":"checksum","value":"4cca594a61204d3751aaf42360e2df1c61360e1f","enabled":true},{"key":"metazourl","value":"https://your.metazo.domain","enabled":true},{"key":"datatype","value":"comment","enabled":true},{"key":"search","value":"1000;Api","enabled":true},{"key":"searchfield","value":"objectid;subject","enabled":true},{"key":"searchcomp","value":"GREATER;LIKE","enabled":true},{"key":"searchandor","value":"AND","enabled":true},{"key":"fields","value":"subject,content","enabled":true},{"key":"limit","value":"20","enabled":true},{"key":"offset","value":"0","enabled":true},{"key":"fileid","value":"2256","enabled":true},{"key":"session_language","value":"EN","enabled":true},{"key":"token","value":"","enabled":true},{"key":"create_comment_model","value":"create","enabled":true},{"key":"comment_objectid","value":"","enabled":true},{"key":"language","value":"","enabled":true},{"key":"testusertoken","value":"ipwsystems1234567890metazo12345","enabled":true},{"key":"quickfilterid","value":"5784","enabled":true},{"key":"includeinactive","value":"0","enabled":true},{"key":"advanced","value":"0","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/fc78d5cc8db29b2e951ae3ebe672e08a3186f11bd1399ef1c332a406a867fd5a","favicon":"https://ipw.dk/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":"IPW API v1","value":"11904435-87c58e8c-9c35-4fc2-bed8-7dfc9fdbadb3"}],"canonicalUrl":"https://metazoapi.support.ipw.dk/view/metadata/RzteUDJ5"}