{"info":{"_postman_id":"d1c1580c-20a4-4948-b246-fe3283bfcdb8","name":"Teach on Mars Web Services","description":"<html><head></head><body><p>This is the documentation for the Teach on Mars Web Services that are frequently used by our partners.</p>\n<p>If you want to try those routes for yourself, you should start by setting up your environment variables:</p>\n<ul>\n<li>Download the <a href=\"https://github.com/TeachonMars/WebservicesAPI/raw/master/doc/TOMEnvironmentBlueprint.postman_environment.json\">Teach on Mars environment blueprint</a></li>\n<li>Update the environment variables with the information that the Teach on Mars team gave you.</li>\n</ul>\n<p>Then you can click on <strong>Run in Postman</strong> and try out the services.</p>\n<p>More information in our <a href=\"https://support.teachonmars.com/hc/en-us/articles/360039561412\">Help Center</a>.</p>\n<p>If your integration project require API routes that are not documented here, please contact your Teach on Mars Project Manager.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"3269225","collectionId":"d1c1580c-20a4-4948-b246-fe3283bfcdb8","publishedId":"SzRuZY4m","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-02-14T08:35:41.000Z"},"item":[{"name":"Learners Management","item":[{"name":"Learners CSV Import","item":[{"name":"Learner CSV Import","event":[{"listen":"test","script":{"id":"89e8f5c5-7cd8-4c18-ab4a-eeedfa47fdd1","exec":["var jsonData = pm.response.json();","pm.environment.set(\"lastImportId\", jsonData.response.importId);"],"type":"text/javascript"}}],"id":"1224132f-dcae-46af-b1ea-1f7c5c639ec4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n    \"data\": \"login;email;firstname;lastname;metacompany\\njohn.doe87264872837T24;john.doe@example.com;John;Doe;Example\"\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/learner/csv","description":"<p>To update and create a massive amount of learners in the Mission Center, the best way is to send a batch of CSV data. Here's how it works.</p>\n<p>The learners CSV import works in two steps:</p>\n<ul>\n<li>Send the data for validation (this request)</li>\n<li>There you get a report on the data you have sent</li>\n<li>Confirm the import</li>\n<li>If the first step was successful, this is where the import is actually applied to the database</li>\n</ul>\n<p>Prepare a CSV file with the following requirements:</p>\n<ul>\n<li>Delimiter: ;</li>\n<li>Encoding: UTF-8</li>\n<li>First line (header line) defines the fields\nYou can obtain such a file using the learner export in the Mission Center, or with an automated export process. Here's how it should look:</li>\n</ul>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>login;firstname;lastname;email;status;metacountry(Country);metadepartment john.doe;John;Doe;john.doe@company.com;A;\"France\";Sales\n</code></pre><p>Then you'll need to work on this data so it can fit into the following JSON payload. Here's what you need to do:</p>\n<ul>\n<li>Replace new lines with \\n characters</li>\n<li>Escape \" quotes so it doesn't break the JSON format</li>\n</ul>\n<p><a href=\"https://github.com/TeachonMars/WebservicesAPI/raw/master/doc/ToM_API_Learners_CSV_Import.pdf\">Detailed documentation</a></p>\n","urlObject":{"path":["api","v3","learner","csv"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1224132f-dcae-46af-b1ea-1f7c5c639ec4"},{"name":"Learner CSV Import Confirm","event":[{"listen":"prerequest","script":{"id":"45ba501b-b511-4692-b57d-8e36fa801cd2","exec":[""],"type":"text/javascript"}}],"id":"36977b5c-ea7b-404f-9c12-751cf9c4f834","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/learner/csv/:importId","description":"<p>To confirm the import, just send a POST request with no payload to the following URL:</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/v3/learner/csv/{importId}\n</code></pre><p>If the importId does not correspond to an import with the status S, you will receive an error.To confirm the import, just send a POST request with no payload.</p>\n","urlObject":{"path":["api","v3","learner","csv",":importId"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[{"type":"any","value":"{{lastImportId}}","key":"importId"}]}},"response":[],"_postman_id":"36977b5c-ea7b-404f-9c12-751cf9c4f834"}],"id":"ab5eebf2-e994-4a0f-8e25-d240aa90754a","description":"<p>To update and create a massive amount of learners in the Mission Center, the best way is to send a batch of CSV data. Here's how it works.</p>\n<p>The learners CSV import works in two steps:\nSend the data for validation\nThere you get a report on the data you have sent\nConfirm the import\nIf the first step was successful, this is where the import is actually applied to the database</p>\n","_postman_id":"ab5eebf2-e994-4a0f-8e25-d240aa90754a"},{"name":"Fetch learner","event":[{"listen":"prerequest","script":{"id":"4a402558-a9f7-48b0-9254-dc39cd34afb0","exec":[""],"type":"text/javascript"}}],"id":"811dd44b-c1e0-4083-b7d6-66b27c9713c8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"url":"{{TOM_API_HOST}}/api/v3/learner","description":"<p>Returns a paginated list of learners according to the given parameters.</p>\n","urlObject":{"path":["api","v3","learner"],"host":["{{TOM_API_HOST}}"],"query":[{"disabled":true,"description":{"content":"<p>Limit the number of learners in the paginated response (default value: 10)</p>\n","type":"text/plain"},"key":"limit","value":"10"},{"disabled":true,"key":"page","value":"1"},{"disabled":true,"description":{"content":"<p>Filter enrolled learners only</p>\n","type":"text/plain"},"key":"activeOnly","value":""},{"disabled":true,"description":{"content":"<p>Search for learners matching the search query string. Match is tested against firstname, lastname, login and email</p>\n","type":"text/plain"},"key":"search","value":""},{"disabled":true,"description":{"content":"<p>Choose the field to sort the result-set : login, email, firstname, nickname, status, lang, guid, debug, theme</p>\n","type":"text/plain"},"key":"orderCol","value":"login"},{"disabled":true,"description":{"content":"<p>Filter learners using custom fields</p>\n","type":"text/plain"},"key":"filters[country]","value":"France"},{"disabled":true,"key":"logins[0]","value":""}],"variable":[]}},"response":[{"id":"bc0971ec-2776-4a32-82b8-d2cd36ba1728","name":"Fetch learner","originalRequest":{"method":"GET","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"url":{"raw":"{{TOM_API_HOST}}/api/v3/learner?","host":["{{TOM_API_HOST}}"],"path":["api","v3","learner"],"query":[{"description":"Search one or multiple learners using their logins","key":"logins[0]","value":"johndoe@example.com","disabled":true},{"description":"Filter enrolled learners only","key":"activeOnly","value":"true","disabled":true},{"description":"Search for learners matching the search query string. Match is tested against firstname, lastname, login and email","key":"search","value":"john","disabled":true},{"description":"Limit the number of learners in the paginated response (default value: 10)","key":"limit","value":"10","disabled":true},{"description":"Select the page that is returned by the service. (default value: 1)","key":"page","value":"1","disabled":true},{"key":"orderCol","value":"login","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Content-Type","value":"application/json"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=75"},{"key":"Set-Cookie","value":"PHPSESSID=5iiqecl6frq6dda5t7gl5bn7a2; path=/"},{"key":"Set-Cookie","value":"userdata_session=eyJpdiI6InRncWR4M3RTcXhXNCtMa3BhRG9saXc9PSIsInZhbHVlIjoidW9HaENEV1hzQWh1R2FDWnZFcUdPUzNlZGZuTEpVR1JXR1JOVkJ0MHpxVUNTaDJYMHhKMkJtbzRuZHRRb1RjUlVpaHBBS21oMDFwT0E0TGxtcmFrRXc9PSIsIm1hYyI6IjljN2JlNGUzMDRlMmI4MTc1NWU1MDkwYjA0NTQ1NWM5YTBkYTJjZTY0YjgyYzVmMmQwODQ1YTIzYmUzMWFjYmMifQ%3D%3D; expires=Wed, 04-Mar-2020 10:16:01 GMT; Max-Age=7200; path=/; httponly"},{"key":"Expires","value":"Thu, 19 Nov 1981 08:52:00 GMT"},{"key":"Cache-Control","value":"no-store, no-cache, must-revalidate, post-check=0, pre-check=0"},{"key":"Cache-Control","value":"no-cache"},{"key":"Pragma","value":"no-cache"},{"key":"Date","value":"Wed, 04 Mar 2020 08:16:01 GMT"},{"key":"Server","value":"ToM"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Allow-Headers","value":"Access-Control-Allow-Origin, Accept, origin, content-type, X-TOM-NONCE, X-TOM-RTS, X-TOM-APP, X-TOM-API-HASH, X-TOM-API-KEY, X-TOM-DEVICE-LANGUAGE, X-TOM-APPLICATION-LANGUAGE, X-TOM-LEARNER-ID, X-TOM-AUTH-TOKEN, X-TOM-DEVICE-PLATFORM"},{"key":"Access-Control-Allow-Methods","value":"DELETE, POST, GET, PATCH, PUT"},{"key":"Access-Control-Expose-Headers","value":"X-TOM-NEXT-TOKEN"}],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"list\": [\n            {\n                \"learnerId\": \"tGh36f20-9850-11e7-91f7-154587089c87\",\n                \"login\": \"john.doe\",\n                \"email\": \"john.doe@example.com\",\n                \"firstname\": \"John\",\n                \"lastname\": \"Doe\",\n                \"status\": \"A\",\n                \"lang\": \"fr\",\n                \"avatar\": \"user/tGh36f20-9850-11e7-91f7-154587089c87/avatar/44df5ebf78d46af9594b4a47a37d234df4eb1a58773c6d10af6654f678d2915f\",\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"France\"\n                },\n                \"sandboxTester\": true,\n                \"createdAt\": 1505278723,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            },\n            {\n                \"learnerId\": \"tGh0604f-7cd4-4f75-b71e-7bd582aca3ed\",\n                \"login\": \"jane.doe\",\n                \"email\": \"jane.doe@example.com\",\n                \"firstname\": \"Jane\",\n                \"lastname\": \"Doe\",\n                \"status\": \"I\",\n                \"lang\": \"fr\",\n                \"avatar\": null,\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"France\"\n                },\n                \"sandboxTester\": false,\n                \"createdAt\": 1555422344,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            },\n            {\n                \"learnerId\": \"tGh95f30-f16c-11e7-b2fd-a9cd5d611d07\",\n                \"login\": \"anthony.johnson\",\n                \"email\": \"anthony.johnson@my-company.com\",\n                \"firstname\": \"Anthony\",\n                \"lastname\": \"Johnson\",\n                \"status\": \"I\",\n                \"lang\": \"en\",\n                \"avatar\": \"user/tGh95f30-f16c-11e7-b2fd-a9cd5d611d07/avatar/ac87141fedcaaf41ca421a0644fa3da49276488b799f69e46dcd681cf6aaa288\",\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"France\"\n                },\n                \"sandboxTester\": true,\n                \"createdAt\": 1515083360,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            },\n            {\n                \"learnerId\": \"tGhe53c0-9fc4-11e8-916e-7fd50a55361f\",\n                \"login\": \"elena.jones\",\n                \"email\": \"elena.jones@my-company.com\",\n                \"firstname\": \"Elena\",\n                \"lastname\": \"Jones\",\n                \"status\": \"I\",\n                \"lang\": \"en\",\n                \"avatar\": \"user/tGhe53c0-9fc4-11e8-916e-7fd50a55361f/avatar/2d62598e8c90a4cc38c2907fdf7d3348fa70b124af5b8f482863d47c3a95406f\",\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"\"\n                },\n                \"sandboxTester\": true,\n                \"createdAt\": 1534245338,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            },\n            {\n                \"learnerId\": \"tGh88480-aff5-11e6-99b8-83ea39b739e8\",\n                \"login\": \"mary.poppins\",\n                \"email\": \"mary.poppins@enchanted.com\",\n                \"firstname\": \"Mary\",\n                \"lastname\": \"Poppins\",\n                \"status\": \"A\",\n                \"lang\": \"fr\",\n                \"avatar\": null,\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"\"\n                },\n                \"sandboxTester\": true,\n                \"createdAt\": 1479734324,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            },\n            {\n                \"learnerId\": \"tGhfee82-48be-4e4c-934d-ce0f16fa6a6a\",\n                \"login\": \"roger.rabbit\",\n                \"email\": \"roger.rabbit@my-company.com\",\n                \"firstname\": \"Roger\",\n                \"lastname\": \"Rabbit\",\n                \"status\": \"A\",\n                \"lang\": \"en\",\n                \"avatar\": null,\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"\"\n                },\n                \"sandboxTester\": true,\n                \"createdAt\": 1556376565,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            },\n            {\n                \"learnerId\": \"tGh02b3d-41bd-4bb0-b34b-3fe812758b56\",\n                \"login\": \"michael.mitchell\",\n                \"email\": \"michael.mitchell@my-company.net\",\n                \"firstname\": \"Michael\",\n                \"lastname\": \"Mitchell\",\n                \"status\": \"A\",\n                \"lang\": \"en\",\n                \"avatar\": null,\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"\"\n                },\n                \"sandboxTester\": false,\n                \"createdAt\": 1558072361,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            },\n            {\n                \"learnerId\": \"tGh5e820-76bf-11e7-8201-b1010708107c\",\n                \"login\": \"judy.pane\",\n                \"email\": \"judy.pane@my-company.com\",\n                \"firstname\": \"Judy\",\n                \"lastname\": \"Pane\",\n                \"status\": \"I\",\n                \"lang\": \"fr\",\n                \"avatar\": \"user/tGh5e820-76bf-11e7-8201-b1010708107c/avatar/e742259ce5e47805ebe1f47797ac4f0604d4b336abc60ecec6346d8469f6f621\",\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"\"\n                },\n                \"sandboxTester\": true,\n                \"createdAt\": 1501587898,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            },\n            {\n                \"learnerId\": \"tGh40802-4db7-4fa4-8f46-c07b6c11b9ab\",\n                \"login\": \"patrice.smith\",\n                \"email\": \"patrice.smith@my-company.com\",\n                \"firstname\": \"Patrice\",\n                \"lastname\": \"Smith\",\n                \"status\": \"A\",\n                \"lang\": \"fr\",\n                \"avatar\": null,\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"\"\n                },\n                \"sandboxTester\": true,\n                \"createdAt\": 1573821866,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": false\n                }\n            },\n            {\n                \"learnerId\": \"tGh83588-b5f2-4948-8a6c-22ad8b4407ff\",\n                \"login\": \"anne\",\n                \"email\": \"anne.schiefer57440@gmail.com\",\n                \"firstname\": \"anne\",\n                \"lastname\": \"schiefer\",\n                \"status\": \"I\",\n                \"lang\": \"fr\",\n                \"avatar\": null,\n                \"metadata\": {\n                    \"company\": \"My Company\",\n                    \"country\": \"\"\n                },\n                \"sandboxTester\": true,\n                \"createdAt\": 1560931953,\n                \"title\": null,\n                \"tos\": {\n                    \"version\": 6,\n                    \"tosUpdated\": true\n                }\n            }\n        ],\n        \"orderCol\": \"login\",\n        \"orderDir\": \"asc\",\n        \"count\": 123,\n        \"page\": 1,\n        \"pagecount\": 13,\n        \"index\": 0,\n        \"pageSize\": 0\n    }\n}"}],"_postman_id":"811dd44b-c1e0-4083-b7d6-66b27c9713c8"},{"name":"Create learner","event":[{"listen":"prerequest","script":{"id":"b95ef202-c76c-48ac-810a-6a6f5e4658ea","exec":[""],"type":"text/javascript"}}],"id":"8f63ba52-65e5-4c91-a305-43117da7a677","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"login\" : \"john.doe\",\n\t\"firstname\" : \"John\",\n\t\"lastname\" : \"Doe\",\n\t\"email\" : \"john.doe@example.com\",\n\t\"password\" : \"ACu$tomPassword!\",\n\t\"metadata\": {\n        \"country\": \"France\",\n        \"company\": \"My Company\"\n\t},\n\t\"lang\": \"fr\",\n\t\"options\": {\n\t\t\"notifyLearner\": false\n\t}\n}"},"url":"{{TOM_API_HOST}}/api/v3/learner","description":"<p>Creates a new learner in the Mission Center.</p>\n","urlObject":{"path":["api","v3","learner"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[]}},"response":[{"id":"50a9b561-dfae-40d6-8d1a-b7e88ebbd34b","name":"Create learner - 200 OK","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"login\" : \"john.doe\",\n\t\"firstname\" : \"John\",\n\t\"lastname\" : \"Doe\",\n\t\"email\" : \"john.doe@example.com\",\n\t\"password\" : \"ACu$tomPassword!\",\n\t\"metadata\": {\n        \"country\": \"France\",\n        \"company\": \"My Company\"\n\t},\n\t\"lang\": \"fr\",\n\t\"options\": {\n\t\t\"notifyLearner\": false\n\t}\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/learner"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"learnerId\": \"tGh36f20-9850-11e7-91f7-154587089c87\",\n        \"login\": \"john.doe\",\n        \"email\": \"john.doe@example.com\",\n        \"firstname\": \"John\",\n        \"lastname\": \"Doe\",\n        \"status\": \"A\",\n        \"lang\": \"fr\",\n        \"avatar\": \"user/tGh36f20-9850-11e7-91f7-154587089c87/avatar/44df5ebf78d46af9594b4a47a37d234df4eb1a58773c6d10af6654f678d2915f\",\n        \"metadata\": {\n            \"company\": \"My Company\",\n            \"country\": \"France\"\n        },\n        \"sandboxTester\": true,\n        \"createdAt\": 1505278723,\n        \"title\": null,\n        \"tos\": {\n            \"version\": 6,\n            \"tosUpdated\": true\n        }\n    }\n}"},{"id":"51866581-f293-43fe-b093-295f6e1917d6","name":"Create learner - 409 LEARNER_PARAM_LOGIN_ALREADY_EXISTS","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"login\" : \"john.doe\",\n\t\"firstname\" : \"John\",\n\t\"lastname\" : \"Doe\",\n\t\"email\" : \"john.doe@example.com\",\n\t\"password\" : \"ACu$tomPassword!\",\n\t\"metadata\": {\n        \"country\": \"France\",\n        \"company\": \"My Company\"\n\t},\n\t\"lang\": \"fr\",\n\t\"options\": {\n\t\t\"notifyLearner\": false\n\t}\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/learner"},"status":"Conflict","code":409,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 409,\n        \"msg\": \"LEARNER_PARAM_LOGIN_ALREADY_EXISTS\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"},{"id":"5fba688d-6968-4b71-9c56-709cc707944a","name":"Create learner - 400 LEARNER_PARAMS_INVALID","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"login\" : \"john.doe\",\n\t\"firstname\" : \"John\",\n\t\"lastname\" : \"Doe\",\n\t\"email\" : \"john.doe\",\n\t\"password\" : \"ACu$tomPassword!\",\n\t\"metadata\": {\n        \"country\": \"France\",\n        \"company\": \"My Company\"\n\t},\n\t\"lang\": \"fr\",\n\t\"options\": {\n\t\t\"notifyLearner\": false\n\t}\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/learner"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 400,\n        \"msg\": \"LEARNER_PARAMS_INVALID\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"},{"id":"c5197161-6bf6-487d-ad63-34597cbf441e","name":"Create learner - 400 LEARNER_PARAM_NICKNAME_MISSING","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"login\" : \"\",\n\t\"firstname\" : \"John\",\n\t\"lastname\" : \"Doe\",\n\t\"email\" : \"john.doe@example.com\",\n\t\"password\" : \"ACu$tomPassword!\",\n\t\"metadata\": {\n        \"country\": \"France\",\n        \"company\": \"My Company\"\n\t},\n\t\"lang\": \"fr\",\n\t\"options\": {\n\t\t\"notifyLearner\": false\n\t}\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/learner"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 400,\n        \"msg\": \"LEARNER_PARAM_NICKNAME_MISSING\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"}],"_postman_id":"8f63ba52-65e5-4c91-a305-43117da7a677"},{"name":"Get learner from learnerId","event":[{"listen":"prerequest","script":{"id":"4a402558-a9f7-48b0-9254-dc39cd34afb0","exec":[""],"type":"text/javascript"}}],"id":"c098f9ff-3d2f-43ff-8551-e52d001c80b6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"url":"{{TOM_API_HOST}}/api/v3/learner/:learnerId","description":"<p>Returns the information of the learner with the given learnerId.</p>\n","urlObject":{"path":["api","v3","learner",":learnerId"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[{"type":"string","value":"","key":"learnerId"}]}},"response":[{"id":"154f79d8-eec0-4721-a60d-e480553d4dc8","name":"Get learner from learnerId - 200 OK","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"url":{"raw":"{{TOM_API_HOST}}/api/v3/learner/:learnerId","host":["{{TOM_API_HOST}}"],"path":["api","v3","learner",":learnerId"],"variable":[{"key":"learnerId","value":"tGh36f20-9850-11e7-91f7-154587089c87"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"learnerId\": \"tGh36f20-9850-11e7-91f7-154587089c87\",\n        \"login\": \"john.doe\",\n        \"email\": \"john.doe@example.com\",\n        \"firstname\": \"John\",\n        \"lastname\": \"Doe\",\n        \"status\": \"A\",\n        \"lang\": \"fr\",\n        \"avatar\": \"user/tGh36f20-9850-11e7-91f7-154587089c87/avatar/44df5ebf78d46af9594b4a47a37d234df4eb1a58773c6d10af6654f678d2915f\",\n        \"metadata\": {\n            \"company\": \"My Company\",\n            \"country\": \"France\"\n        },\n        \"sandboxTester\": true,\n        \"createdAt\": 1505278723,\n        \"title\": null,\n        \"tos\": {\n            \"version\": 6,\n            \"tosUpdated\": true\n        }\n    }\n}"},{"id":"e33ddcab-6764-49f7-bb73-8c5ed5cc4ae1","name":"Get learner from learnerId - 404 LEARNER_NOT_FOUND","originalRequest":{"method":"GET","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"url":{"raw":"{{TOM_API_HOST}}/api/v3/learner/:learnerId","host":["{{TOM_API_HOST}}"],"path":["api","v3","learner",":learnerId"],"variable":[{"key":"learnerId","value":"somelearneridthatdoesntexist"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 404,\n        \"msg\": \"LEARNER_NOT_FOUND\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"}],"_postman_id":"c098f9ff-3d2f-43ff-8551-e52d001c80b6"},{"name":"Update learner","event":[{"listen":"prerequest","script":{"id":"b95ef202-c76c-48ac-810a-6a6f5e4658ea","exec":[""],"type":"text/javascript"}}],"id":"fc1d0099-23c7-4f10-bdea-d3b4100ed864","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"firstname\": \"John\",\n\t\"lastname\": \"Done\",\n    \"email\": \"john.done@company.com\",\n    \"status\": \"A\"\n}"},"url":"{{TOM_API_HOST}}/api/v3/learner/:learnerId/update","description":"<p>Updates the information of the learner with the given learnerId. Only the fields in the body will be updated, other will remain unchanged.</p>\n<p>Notes:</p>\n<ul>\n<li>The login cannot be changed through this service</li>\n<li>The status can be set to \"A\" or \"I\" (enrolled or unenrolled)</li>\n</ul>\n","urlObject":{"path":["api","v3","learner",":learnerId","update"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[{"type":"string","value":"","key":"learnerId"}]}},"response":[{"id":"af246a99-969e-4041-894e-dc559c587083","name":"Update learner - 200 OK","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"firstname\": \"John\",\n\t\"lastname\": \"Done\",\n    \"email\": \"john.done@company.com\",\n    \"status\": \"A\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{TOM_API_HOST}}/api/v3/learner/:learnerId/update","host":["{{TOM_API_HOST}}"],"path":["api","v3","learner",":learnerId","update"],"variable":[{"key":"learnerId","value":"tGh36f20-9850-11e7-91f7-154587089c87"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"learnerId\": \"tGh36f20-9850-11e7-91f7-154587089c87\",\n        \"login\": \"john.doe\",\n        \"email\": \"john.done@company.com\",\n        \"firstname\": \"John\",\n        \"lastname\": \"Done\",\n        \"status\": \"A\",\n        \"lang\": \"fr\",\n        \"avatar\": \"user/tGh36f20-9850-11e7-91f7-154587089c87/avatar/44df5ebf78d46af9594b4a47a37d234df4eb1a58773c6d10af6654f678d2915f\",\n        \"metadata\": {\n            \"company\": \"My Company\",\n            \"country\": \"France\"\n        },\n        \"sandboxTester\": true,\n        \"createdAt\": 1505278723,\n        \"title\": null,\n        \"tos\": {\n            \"version\": 6,\n            \"tosUpdated\": true\n        }\n    }\n}"},{"id":"ba4967a3-a8e2-4244-b6d5-52a4b827b72f","name":"Update learner - 400 LEARNER_PARAMS_INVALID","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"email\": \"john.doe\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{TOM_API_HOST}}/api/v3/learner/:learnerId/update","host":["{{TOM_API_HOST}}"],"path":["api","v3","learner",":learnerId","update"],"variable":[{"key":"learnerId","value":"tGh36f20-9850-11e7-91f7-154587089c87"}]}},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 400,\n        \"msg\": \"LEARNER_PARAMS_INVALID\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"},{"id":"d88a1c6e-7d21-4e73-8894-7b946c290eff","name":"Update learner - 404 LEARNER_NOT_FOUND","originalRequest":{"method":"PUT","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"firstname\": \"John\",\n\t\"lastname\": \"Done\"\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"{{TOM_API_HOST}}/api/v3/learner/:learnerId/update","host":["{{TOM_API_HOST}}"],"path":["api","v3","learner",":learnerId","update"],"variable":[{"key":"learnerId","value":"somelearnerifthatdoesntexist"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 404,\n        \"msg\": \"LEARNER_NOT_FOUND\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"}],"_postman_id":"fc1d0099-23c7-4f10-bdea-d3b4100ed864"},{"name":"Delete Learner","event":[{"listen":"prerequest","script":{"id":"b95ef202-c76c-48ac-810a-6a6f5e4658ea","exec":[""],"type":"text/javascript"}}],"id":"863a3b88-a813-41b5-a71c-159a92c71f03","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":""},"url":"{{TOM_API_HOST}}/api/v3/learner/:learnerId","description":"<p>Deletes entirely the learner with the given learnerId. </p>\n<p><strong>WARNING</strong>: This operation is irreversible. If you wish to deactivate the learner instead, change the status to <em>I</em>.</p>\n","urlObject":{"path":["api","v3","learner",":learnerId"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[{"type":"string","value":"","key":"learnerId"}]}},"response":[{"id":"2e8977cf-bf6e-4de4-b501-7e68b434f42d","name":"Delete Learner - 200 OK","originalRequest":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{TOM_API_HOST}}/api/v3/learner/:learnerId","host":["{{TOM_API_HOST}}"],"path":["api","v3","learner",":learnerId"],"variable":[{"key":"learnerId","value":"tGh36f20-9850-11e7-91f7-154587089c87"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"},{"id":"ab5c15c2-7bbd-4436-848d-cadd3cc45521","name":"Delete Learner - 404 LEARNER_NOT_FOUND","originalRequest":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":""},"url":{"raw":"{{TOM_API_HOST}}/api/v3/learner/:learnerId","host":["{{TOM_API_HOST}}"],"path":["api","v3","learner",":learnerId"],"variable":[{"key":"learnerId","value":"somelearneridthatdoesntexist"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 404,\n        \"msg\": \"LEARNER_NOT_FOUND\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"}],"_postman_id":"863a3b88-a813-41b5-a71c-159a92c71f03"}],"id":"2ac65a8d-5f20-4189-ad3b-bc402c4aeb0f","description":"<p>This is a set of routes to deal with the learners (users who access the application).</p>\n","event":[{"listen":"prerequest","script":{"id":"4b533cae-73a6-4168-bde2-7a8b3e102ebc","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"4c2a629d-777b-4019-aa37-622cdb541b96","type":"text/javascript","exec":[""]}}],"_postman_id":"2ac65a8d-5f20-4189-ad3b-bc402c4aeb0f"},{"name":"Identity Token","item":[{"name":"Verify Identity Token","event":[{"listen":"prerequest","script":{"id":"b95ef202-c76c-48ac-810a-6a6f5e4658ea","exec":[""],"type":"text/javascript"}}],"id":"0da28156-f6cf-4f75-b6d6-8ec69cd7cff0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"learnerId\" : \"\",\n\t\"token\" : \"\"\n}"},"url":"{{TOM_API_HOST}}/api/v3/verifyIdentityToken","description":"<p>It is possible to create a secondary service that brings new features to the app by using data from the Mission Center webservices. This service must be a web based and online application and could be, for instance, a new profiling quiz, a gift shop, a messaging service, etc.</p>\n<p>The key part to implementing this kind of service is identifying the learner. This is where the Identity token comes into play. We are going to go over how it should be used step by step.</p>\n<p>More information in the <a href=\"https://support.teachonmars.com/hc/en-us/articles/360040539311-How-to-identify-a-learner-in-my-service\">Help Center</a>.</p>\n","urlObject":{"path":["api","v3","verifyIdentityToken"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[]}},"response":[{"id":"6eb6ee2b-cd30-484a-bea9-7ef5905b801b","name":"Verify Identity Token - 200 OK","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"learnerId\" : \"tGh36f20-9850-11e7-91f7-154587089c87\",\n\t\"token\" : \"sometokenobtainedfromtheapp\"\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/verifyIdentityToken"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"authToken\": \"fTeEgf47J9vTr98\"\n    }\n}"},{"id":"8744c96f-edce-461f-b5a7-527d25293f0b","name":"Verify Identity Token - 404 IDENTITY_VERIF_FAILED","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"learnerId\" : \"tGh36f20-9850-11e7-91f7-154587089c87\",\n\t\"token\" : \"somewrongtoken\"\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/verifyIdentityToken"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 404,\n        \"msg\": \"IDENTITY_VERIF_FAILED\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"},{"id":"cf4d55f0-243d-4723-bf7e-b6d5464d66c6","name":"Verify Identity Token - 404 IDENTITY_VERIF_TOKEN_MISSING","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"learnerId\" : \"tGh36f20-9850-11e7-91f7-154587089c87\",\n\t\"token\" : \"\"\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/verifyIdentityToken"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 404,\n        \"msg\": \"IDENTITY_VERIF_TOKEN_MISSING\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"},{"id":"ebf3c889-f453-409c-93d7-c24e93ee3db4","name":"Verify Identity Token - 404 IDENTITY_VERIF_LEARNERID_MISSING","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"learnerId\": \"\",\n\t\"token\": \"sometokenobtainedfromtheapp\"\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/verifyIdentityToken"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 404,\n        \"msg\": \"IDENTITY_VERIF_LEARNERID_MISSING\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"}],"_postman_id":"0da28156-f6cf-4f75-b6d6-8ec69cd7cff0"}],"id":"c6ae7a53-5ddd-4e78-b4c6-feaa24d9585b","_postman_id":"c6ae7a53-5ddd-4e78-b4c6-feaa24d9585b","description":""},{"name":"Authentication Token","item":[{"name":"Generate Authentication Token","event":[{"listen":"prerequest","script":{"id":"b95ef202-c76c-48ac-810a-6a6f5e4658ea","exec":[""],"type":"text/javascript"}}],"id":"812447da-4438-4896-bc66-57d404b2130d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"learnerId\" : \"a835a8ea-d609-45ec-963f-a6a5b7c8fe23\"\n}"},"url":"{{TOM_API_HOST}}/api/v3/device/auth/token","description":"<p>Authentication Tokens are used to have the learner directly logged in when he launches the application (or webapp). If the learner is already logged in your system, you can claim an anthentication token, and use it to logged the learner in the app.</p>\n<p>More information in the <a href=\"https://support.teachonmars.com/hc/en-us/articles/360040541971#loglearner\">Help Center</a>.</p>\n","urlObject":{"path":["api","v3","device","auth","token"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[]}},"response":[{"id":"f4498293-f356-4a95-b6cb-de84b4e416b6","name":"Generate Authentication Token - 200 OK","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"learnerId\" : \"tGh36f20-9850-11e7-91f7-154587089c87\"\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/device/auth/token"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"authToken\": \"fTeEgf47J9vTr98\"\n    }\n}"}],"_postman_id":"812447da-4438-4896-bc66-57d404b2130d"}],"id":"1afad2a6-f177-470b-b97c-e93770d853c4","_postman_id":"1afad2a6-f177-470b-b97c-e93770d853c4","description":""},{"name":"Training Course Registrations","item":[{"name":"Import Registrations","event":[{"listen":"prerequest","script":{"id":"b95ef202-c76c-48ac-810a-6a6f5e4658ea","exec":[""],"type":"text/javascript"}}],"id":"5d2a7d9a-4508-4086-b81d-b7e6a3e0644d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"data\": [\n\t\t{\n\t\t\t\"learnerId\": \"john.doe\",\n\t\t\t\"trainingId\": \"sales-101\",\n\t\t\t\"accessSince\": \"24/01/2020\"\n\t\t},\n\t\t{\n\t\t\t\"learnerId\": \"john.doe\",\n\t\t\t\"trainingId\": \"management-101\",\n\t\t\t\"accessSince\": \"24/01/2020\",\n\t\t\t\"accessUntil\": \"01/04/2020\"\n\t\t}\n\t]\n}"},"url":"{{TOM_API_HOST}}/api/v3/training/access/import","description":"<p>Allows you to grant, schedule and revoke access to training courses.</p>\n<ul>\n<li>Each item of the payload relates to a pair <em>learner / training course</em>.<ul>\n<li>learnerId is the login or learnerId of the learner</li>\n<li>trainingId is the reference code / training id of the training course</li>\n</ul>\n</li>\n<li>Each item will create or update the registration status of the learner on the training course</li>\n<li>To specify dates <em>accessSince</em> and <em>accessUntil</em>, use the format dd/mm/yyyy</li>\n<li>You can schedule to give a learner access to a training course by setting <em>accessSince</em> to a date in the future</li>\n<li>To revoke access as soon as possible, set \"accessUntil\" to the date of tomorrow. Access will be closed at midnight.</li>\n</ul>\n<p><strong>The import data must be confirmed to be applied to the database (see Import Registrations Confirmation below).</strong></p>\n","urlObject":{"path":["api","v3","training","access","import"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[]}},"response":[{"id":"4b335761-140a-42b4-a2c1-60dbc5e3ab06","name":"Import Registrations - 200 OK Success","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"data\": [\n\t\t{\n\t\t\t\"learnerId\": \"john.doe\",\n\t\t\t\"trainingId\": \"sales-101\"\n\t\t},\n\t\t{\n\t\t\t\"learnerId\": \"john.doe\",\n\t\t\t\"trainingId\": \"management-101\"\n\t\t}\n\t]\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/training/access/import"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"importId\": \"fTeEgf47J9vTr98\",\n        \"status\": 2,\n        \"report\": {\n            \"errors\": []\n        }\n    }\n}"},{"id":"99fb7820-642f-44dc-9b96-7c577e71059e","name":"Import Registrations - 200 OK With errors","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"data\": [\n\t\t{\n\t\t\t\"learnerId\": \"john.doe\",\n\t\t\t\"trainingId\": \"sales-101\"\n\t\t},\n\t\t{\n\t\t\t\"learnerId\": \"john.doe\",\n\t\t\t\"trainingId\": \"sales-101\"\n\t\t},\n\t\t{\n\t\t\t\"learnerId\": \"john.doe\",\n\t\t\t\"trainingId\": \"\"\n\t\t}\n\t]\n}","options":{"raw":{"language":"json"}}},"url":"{{TOM_API_HOST}}/api/v3/training/access/import"},"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"importId\": \"hTfEgf47J9vTr98\",\n        \"status\": 1,\n        \"report\": {\n            \"errors\": [\n                \"Missing parameter trainingId (index 3)\",\n                \"There are duplicates in the registrations list\"\n            ]\n        }\n    }\n}"}],"_postman_id":"5d2a7d9a-4508-4086-b81d-b7e6a3e0644d"},{"name":"Import Registrations Confirmation","event":[{"listen":"prerequest","script":{"id":"b95ef202-c76c-48ac-810a-6a6f5e4658ea","exec":[""],"type":"text/javascript"}}],"id":"67f23114-6a79-485c-b661-3912298b577a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"url":"{{TOM_API_HOST}}/api/v3/training/access/import/:importId","urlObject":{"path":["api","v3","training","access","import",":importId"],"host":["{{TOM_API_HOST}}"],"query":[],"variable":[{"id":"ff5b32ee-4968-48e2-8b16-acb183368546","type":"string","value":"","key":"importId"}]}},"response":[{"id":"87b86ef9-8e1b-4b7d-99ad-5fead2299cde","name":"Import Registrations Confirmation - 406 TRAINING_ACCESS_IMPORT_UNSUCCESSFUL","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"url":{"raw":"{{TOM_API_HOST}}/api/v3/training/access/import/:importId","host":["{{TOM_API_HOST}}"],"path":["api","v3","training","access","import",":importId"],"variable":[{"key":"importId","value":"hTfEgf47J9vTr98"}]}},"status":"Not Acceptable","code":406,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 406,\n        \"msg\": \"TRAINING_ACCESS_IMPORT_UNSUCCESSFUL\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"importId\": \"hTfEgf47J9vTr98\",\n        \"status\": 1,\n        \"report\": {\n            \"errors\": [\n        \t\t\"Missing parameter trainingId (index 3)\",\n        \t\t\"There are duplicates in the registrations list\"\n        \t]\n        }\n    }\n}"},{"id":"c80a55c4-05f7-431f-aeab-828d755c36e9","name":"Import Registrations Confirm - 200 OK","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"url":{"raw":"{{TOM_API_HOST}}/api/v3/training/access/import/:importId","host":["{{TOM_API_HOST}}"],"path":["api","v3","training","access","import",":importId"],"variable":[{"key":"importId","value":"fTeEgf47J9vTr98"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 200,\n        \"msg\": \"OK\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {\n        \"importId\": \"fTeEgf47J9vTr98\",\n        \"status\": 3,\n        \"report\": {\n            \"errors\": []\n        }\n    }\n}"},{"id":"ccad36ed-8dde-4488-97ee-bfe428081070","name":"Import Registrations Confirmation - 404 TRAINING_ACCESS_IMPORT_NOT_FOUND","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"url":{"raw":"{{TOM_API_HOST}}/api/v3/training/access/import/:importId","host":["{{TOM_API_HOST}}"],"path":["api","v3","training","access","import",":importId"],"variable":[{"key":"importId","value":"someimportidthatdoesntexist"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"meta\": {\n        \"status\": 404,\n        \"msg\": \"TRAINING_ACCESS_IMPORT_NOT_FOUND\",\n        \"timestamp\": 1583309761,\n        \"err\": 0,\n        \"errno\": 0\n    },\n    \"response\": {}\n}"}],"_postman_id":"67f23114-6a79-485c-b661-3912298b577a"}],"id":"d2c33318-e17d-44b7-bde2-59c57c8cbc5f","event":[{"listen":"prerequest","script":{"id":"05ad702d-6248-4f1f-b652-eb194401c1ff","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"4bbd4edc-49a4-451b-91e0-a89600aec353","type":"text/javascript","exec":[""]}}],"_postman_id":"d2c33318-e17d-44b7-bde2-59c57c8cbc5f","description":""},{"name":"Tracking Data","item":[{"name":"Data Export by Training course","event":[{"listen":"prerequest","script":{"id":"ba427c58-96eb-4b23-b824-641478b777e6","exec":["function makeid() {","  var text = \"\";","  var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";","","  for (var i = 0; i < 32; i++)","    text += possible.charAt(Math.floor(Math.random() * possible.length));","","  return text;","}","","var ts = + new Date();","ts = (\"\" + ts).substring(0,10);","","","var app = environment.TOM_APP_ID;","var nonce = makeid();","","var api_key = environment.TOM_API_KEY;","var api_secret = environment.TOM_API_SECRET;","","var requestUrl = encodeURI(request.url.replace(/{{(\\w*)}}/g,function(str,key) {return environment[key]}));","","","if (request.method == \"GET\" || request.method == \"DELETE\" ","    || (typeof request.data == \"object\" && JSON.stringify(request.data).length <= 2)","    || (typeof request.data == \"array\" && JSON.stringify(request.data).length <= 2)","    || (!request.headers['content-type'])) {","    var bodyHash = \"\";    ","}","else {","    ","    var bodyHash = request.data;","}","","","var salt = api_secret","    + ts","    + app","    + CryptoJS.MD5( bodyHash + requestUrl) // payload + url","    + nonce;","","","var hash = CryptoJS.SHA256(salt).toString();","","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-API-KEY',","    value: api_key","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-API-HASH',","    value: hash","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-APP',","    value: environment.TOM_APP_ID","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-RTS',","    value: ts","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-NONCE',","    value: nonce","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-APPLICATION-LANGUAGE',","    value: environment.TOM_LEARNER_LANGUAGE | \"fr\"","});",""],"type":"text/javascript"}}],"id":"79a295d4-b61d-4034-ae28-1f0c3e7e8c61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"url":"{{TOM_API_HOST}}/api/v3/export/trainings?export-type=json&training=ace-of-trade&untrained_learners=0&disable_metadata=1&export_locale=fr&filters[company]=Teach on Mars","description":"<p>Returns statistics computed at the moment by training course for each learner within the search parameters. The data can be received in three different formats: Excel file (xls), JSON data (json) or CSV data (csv). The data ouput can be filtered by population (using custom field values) and by training course.</p>\n<p><strong>Importance notice:</strong> This service is quite heavy for the servers, and the response is streamed so getting the whole data can take some time, so we recommend to use it as a daily synchronization mechanism. Also some options will have a serious effect on the amount of data that will be delivered. So please, pay attention to the details of each parameter.</p>\n<p><strong>Columns description</strong></p>\n<p>When calling this service, you may notice some columns that are not referenced in this documentation. They are for Teach on Mars internal use only. </p>\n<p><strong>trainingId:</strong> the reference code of the training course, the same you should use if you wish to filter the results for a single training course</p>\n<p><strong>training:</strong> the title of the training course which is translated at best using the language code given in the export_locale parameter</p>\n<p><strong>mainCategory:</strong> the ID of the category containing the training course with its path</p>\n<p><strong>mainCategoryName:</strong> the name of the category containing the training course with its path</p>\n<p><strong>login:</strong> the login of the learner, it's a unique identifier that the learner uses to log into the application</p>\n<p><strong>firstname:</strong> the first name of the learner</p>\n<p><strong>lastname:</strong>  the last name of the learner</p>\n<p><strong>email:</strong> the email address of the learner</p>\n<p><strong>status:</strong> \"A\" for active (enrolled), \"I\" for inactive (unenrolled)</p>\n<p><strong>time:</strong> the time spent (in seconds) by the learner in the training course</p>\n<p><strong>progress:</strong> the progress reached by the learner in the training course</p>\n<p><strong>points:</strong> the sum of points gathered by the learner in the training course</p>\n<p><strong>certified:</strong> whether the learner has obtained the certification on this training course</p>\n<p><strong>success:</strong> whether the learner has succeeded at all the scored activities in the training course</p>\n<p><strong>firstLaunched:</strong> the date of the first activity launched by the learner in the training course</p>\n<p><strong>lastLaunched:</strong> the date of the last activity launched by the learner in the training course</p>\n<p><strong>nbLaunched:</strong> number of activities launched by the learner in the training course (NB:launching the same activity twice counts as 2)</p>\n<p><strong>score_avg:</strong> the average score (percentage) of the learner in all the scored activities of the training course. (NB:this is the average of all the max scores obtained in each activity)</p>\n<p><strong>enrollment:</strong> date when the learner was first enrolled to the training course</p>\n<p><strong>unenrollment:</strong> date when the learner's access to the training course was revoked (NB:if empty, it means that the learner still has access to the training course).</p>\n<p><strong>company:</strong> all columns (in CSV export) starting from this one are custom fields values configured in the Mission Center (\"company\" is just an example)</p>\n<p><strong>meta*:</strong> all values in this format are custom fields values configured in the Mission Center (Ex: metacompany)</p>\n","urlObject":{"path":["api","v3","export","trainings"],"host":["{{TOM_API_HOST}}"],"query":[{"description":{"content":"<p>(Enum) either csv, json or xls</p>\n","type":"text/plain"},"key":"export-type","value":"json"},{"description":{"content":"<p>(String)  (optional) filter only for one training using its reference code</p>\n","type":"text/plain"},"key":"training","value":"ace-of-trade"},{"description":{"content":"<p>(Enum)  (optional) 1 / 0: set to 1, will include learners that are currently registered to each training course, even if they haven't opened it yet.</p>\n","type":"text/plain"},"key":"untrained_learners","value":"0"},{"description":{"content":"<p>(Enum)  (optional) 1 / 0: set to 1 disables the custom field columns. Also it make the export significantly faster.</p>\n","type":"text/plain"},"key":"disable_metadata","value":"1"},{"description":{"content":"<p>(optional) Determines in which language the training course title will be displayed. If the title is not available in the given language, the default training course language will be used.</p>\n","type":"text/plain"},"key":"export_locale","value":"fr"},{"description":{"content":"<p>(optional) Filters the population of learners using custom fields values. This filter works like the one in the fetch learner service.</p>\n","type":"text/plain"},"key":"filters[company]","value":"Teach on Mars"}],"variable":[]}},"response":[{"id":"aa1bea29-8fd2-4a9f-bb3c-1ea55ce0d0a4","name":"Data Export by Training - JSON Format","originalRequest":{"method":"GET","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"url":{"raw":"https://tom183-excel-userdata.teachonmars.com/api/v3/export/trainings?export-type=json&training=ace-of-trade&untrained_learners=0&disable_metadata=1&export_locale=fr&categories_path_using_normalized_code=0","protocol":"https","host":["tom183-excel-userdata","teachonmars","com"],"path":["api","v3","export","trainings"],"query":[{"key":"export-type","value":"json","description":"(Enum) csv, json, xls"},{"key":"training","value":"ace-of-trade","description":"(String) filter only for one training using its reference code"},{"key":"untrained_learners","value":"0","description":"(Enum) 1 / 0: set to 1, will include learners that are currently registered to each training course, even if they haven't opened it yet."},{"key":"disable_metadata","value":"1","description":"(Enum) 1 / 0: set to 1 disables the custom field columns. Also it make the export significantly faster."},{"key":"export_locale","value":"fr","description":"Determines in which language the training course title will be displayed. If the title is not available in the given language, the default training course language will be used."},{"key":"categories_path_using_normalized_code","value":"0","description":"This parameter removes the timestamp part of the category IDs. If you only need informal information about the categorie, activate this parameters, otherwise, if you need the category IDs to use them elsewhere do not activate it."},{"key":"filters[company]","value":"Teach on Mars","description":"Filter the population of learners using custom fields values. This filter works like the one in the fetch learner endpoint.","disabled":true}]}},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"Content-Type","value":"text/html; charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=75"},{"key":"Cache-Control","value":"no-cache"},{"key":"Date","value":"Thu, 28 May 2020 12:35:07 GMT"},{"key":"Set-Cookie","value":"userdata_session=eyJpdiI6Ikx1MFV2RHZVTHkzN1grUVRaRDFXZHc9PSIsInZhbHVlIjoiUmdRMUhSZnFnQW9XR2FJeEMzQlFad2dVQ1UrcE00dWdcL0xoM2VVZ2MxM0VIZkdpXC9hYzRmdGFQZ1ZKWlwvVzdBRzBIckZoSktoUzRsOWt3V04xUGxOV3c9PSIsIm1hYyI6ImE0ZDM0YjgwMzliYmZjMDU0M2YxNDQyMzdmNTAyZTVlOGQ5NzIyMjQ4M2ZmZTU0MmE5ZjkxMjcyMmUwZTU3OWMifQ%3D%3D; expires=Thu, 28-May-2020 14:35:07 GMT; Max-Age=7200; path=/; HttpOnly"},{"key":"Server","value":"ToM"},{"key":"X-Cache","value":"BYPASS"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Allow-Headers","value":"Access-Control-Allow-Origin, Accept, origin, content-type, X-TOM-NONCE, X-TOM-RTS, X-TOM-APP, X-TOM-API-HASH, X-TOM-API-KEY, X-TOM-DEVICE-LANGUAGE, X-TOM-APPLICATION-LANGUAGE, X-TOM-LEARNER-ID, X-TOM-AUTH-TOKEN, X-TOM-DEVICE-PLATFORM"},{"key":"Access-Control-Allow-Methods","value":"DELETE, POST, GET, PATCH, PUT"},{"key":"Access-Control-Expose-Headers","value":"X-TOM-NEXT-TOKEN"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Strict-Transport-Security","value":"max-age=31536000; includeSubDomains; preload"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"trainingId\": \"ace-of-trade\",\n        \"training\": \"Ace of Trade\",\n        \"mainCategory\": \"demo/games\",\n        \"mainCategoryName\": \"demo/games\",\n        \"login\": \"john.doe\",\n        \"firstname\": \"John\",\n        \"lastname\": \"Doe\",\n        \"email\": \"john.doe@teachonmars.com\",\n        \"status\": \"I\",\n        \"time\": 681,\n        \"progress\": 64,\n        \"points\": 345,\n        \"certified\": false,\n        \"success\": false,\n        \"firstLaunched\": \"24-06-2016 14:18:58\",\n        \"lastLaunched\": \"20-01-2018 08:38:13\",\n        \"nbLaunched\": \"52\",\n        \"score_avg\": 53.333333333333336,\n        \"enrollment\": \"27-06-2016 09:56:57\",\n        \"unenrollment\": null\n    },\n    {\n        \"trainingId\": \"ace-of-trade\",\n        \"training\": \"Ace of Trade\",\n        \"mainCategory\": \"demo/games\",\n        \"mainCategoryName\": \"demo/games\",\n        \"login\": \"jane.doe\",\n        \"firstname\": \"Jane\",\n        \"lastname\": \"Doe\",\n        \"email\": \"jane.doe@teachonmars.com\",\n        \"status\": \"I\",\n        \"time\": 10908,\n        \"progress\": 93,\n        \"points\": 5131,\n        \"certified\": false,\n        \"success\": true,\n        \"firstLaunched\": \"13-07-2016 10:59:49\",\n        \"lastLaunched\": \"17-10-2018 13:23:15\",\n        \"nbLaunched\": \"332\",\n        \"score_avg\": 95.833333333333329,\n        \"enrollment\": \"27-06-2016 09:56:57\",\n        \"unenrollment\": \"19-11-2018 17:19:34\"\n    }\n]"},{"id":"beced1bb-eb15-4ca2-9605-4000172d0f6e","name":"Data Export by Training - CSV format","originalRequest":{"method":"GET","header":[{"key":"Content-Type","type":"text","value":"application/json"}],"url":{"raw":"{{TOM_API_HOST}}/api/v3/export/trainings?export-type=csv&training=&untrained_learners=0&disable_metadata=0&export_locale=fr&filters[company]=Teach on Mars","host":["{{TOM_API_HOST}}"],"path":["api","v3","export","trainings"],"query":[{"key":"export-type","value":"csv","description":"(Enum) csv, json, xls"},{"key":"training","value":"","description":"(String) filter only for one training using its reference code"},{"key":"untrained_learners","value":"0","description":"(Enum) 1 / 0: set to 1, will include learners that are currently registered to each training course, even if they haven't opened it yet."},{"key":"disable_metadata","value":"0","description":"(Enum) 1 / 0: set to 1 disables the custom field columns. Also it make the export significantly faster."},{"key":"export_locale","value":"fr","description":"Determines in which language the training course title will be displayed. If the title is not available in the given language, the default training course language will be used."},{"key":"categories_path_using_normalized_code","value":"","description":"This parameter removes the timestamp part of the category IDs. If you only need informal information about the categorie, activate this parameters, otherwise, if you need the category IDs to use them elsewhere do not activate it.","disabled":true},{"key":"filters[company]","value":"Teach on Mars","description":"Filter the population of learners using custom fields values. This filter works like the one in the fetch learner endpoint."}]}},"status":"OK","code":200,"_postman_previewlanguage":"html","header":[{"key":"Content-Type","value":"text/html; charset=UTF-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=75"},{"key":"Cache-Control","value":"no-cache"},{"key":"Date","value":"Thu, 28 May 2020 07:39:13 GMT"},{"key":"Set-Cookie","value":"userdata_session=eyJpdiI6InNERmJpU2JmT2k4eHBjNlBOOGViRnc9PSIsInZhbHVlIjoiSHR6ZGhSTXgxOVQzNW5sQlwvVGdQQlo5VzV0NzFVd3dLWkxBdm4xb3VzaytHUklIa3ZoODI2UTlmUTE5UGFENnBPaDZFeThWUFZKTUlwcFRjNDNCcUdBPT0iLCJtYWMiOiI3NWFjYTMxZWQ0OGM1MDA2NmM4ODI0MDI5M2IxOWMxY2Y2NDU3MGJkZTJiYzI3Njc4N2NhMzZjYjIxZDM1ZjE2In0%3D; expires=Thu, 28-May-2020 09:39:13 GMT; Max-Age=7200; path=/; HttpOnly"},{"key":"Server","value":"ToM"},{"key":"X-Cache","value":"BYPASS"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Access-Control-Allow-Headers","value":"Access-Control-Allow-Origin, Accept, origin, content-type, X-TOM-NONCE, X-TOM-RTS, X-TOM-APP, X-TOM-API-HASH, X-TOM-API-KEY, X-TOM-DEVICE-LANGUAGE, X-TOM-APPLICATION-LANGUAGE, X-TOM-LEARNER-ID, X-TOM-AUTH-TOKEN, X-TOM-DEVICE-PLATFORM"},{"key":"Access-Control-Allow-Methods","value":"DELETE, POST, GET, PATCH, PUT"},{"key":"Access-Control-Expose-Headers","value":"X-TOM-NEXT-TOKEN"},{"key":"X-Content-Type-Options","value":"nosniff"},{"key":"Strict-Transport-Security","value":"max-age=31536000; includeSubDomains; preload"}],"cookie":[],"responseTime":null,"body":"otsSourceId;trainingId;trainingKey;training;mainCategory;mainCategoryName;category;learnerId;login;firstname;lastname;email;status;time;progress;points;certified;success;firstLaunched;lastLaunched;nbLaunched;score_avg;enrollment;unenrollment;company\n;ace-of-trade;1;\"Ace of Trade\";demo/games;demo/games;demo/games;2;john.doe;John;Doe;john.doe@teachonmars.com;I;681;64;345;;0;\"24-06-2016 14:18:58\";\"20-01-2018 08:38:13\";52;53.333333333333;\"27-06-2016 09:56:57\";;\"Teach on Mars\"\n;ace-of-trade;1;\"Ace of Trade\";demo/games;demo/games;demo/games;5;jane.doe;Jane;Doe;jane.doe@teachonmars.com;I;10908;93;5131;;1;\"13-07-2016 10:59:49\";\"17-10-2018 13:23:15\";332;95.833333333333;\"27-06-2016 09:56:57\";\"19-11-2018 17:19:34\";\"Teach on Mars\";;;fr;\"Teach on Mars\";"}],"_postman_id":"79a295d4-b61d-4034-ae28-1f0c3e7e8c61"}],"id":"ac6e61d1-33c3-42a1-9565-86dd5c1f630d","_postman_id":"ac6e61d1-33c3-42a1-9565-86dd5c1f630d","description":""}],"event":[{"listen":"prerequest","script":{"id":"79190efc-d111-4464-8fad-2aa2ecdb77a6","type":"text/javascript","exec":["function makeid() {","  var text = \"\";","  var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";","","  for (var i = 0; i < 32; i++)","    text += possible.charAt(Math.floor(Math.random() * possible.length));","","  return text;","}","","var ts = + new Date();","ts = (\"\" + ts).substring(0,10);","","","var app = environment.TOM_APP_ID;","var nonce = makeid();","","var api_key = environment.TOM_API_KEY;","var api_secret = environment.TOM_API_SECRET;","","var requestUrl = encodeURI(request.url.replace(/{{(\\w*)}}/g,function(str,key) { return environment[key]? environment[key]:pm.variables.get(key);}));","","","if (request.method == \"GET\" || request.method == \"DELETE\" ","    || (typeof request.data == \"object\" && JSON.stringify(request.data).length <= 2)","    || (typeof request.data == \"array\" && JSON.stringify(request.data).length <= 2)","    || (!request.headers['content-type'])) {","    var bodyHash = \"\";    ","}","else {","    ","    var bodyHash = request.data;","}","","","var salt = api_secret","    + ts","    + app","    + CryptoJS.MD5( bodyHash + requestUrl) // payload + url","    + nonce;","","","var hash = CryptoJS.SHA256(salt).toString();","","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-API-KEY',","    value: api_key","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-API-HASH',","    value: hash","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-APP',","    value: environment.TOM_APP_ID","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-RTS',","    value: ts","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-NONCE',","    value: nonce","});","pm.request.headers.add({","    disabled: false,","    key: 'X-TOM-APPLICATION-LANGUAGE',","    value: environment.TOM_LEARNER_LANGUAGE | \"fr\"","});",""]}},{"listen":"test","script":{"id":"3971716e-369d-4242-a0de-cd5036095d10","type":"text/javascript","exec":[""]}}]}