{"info":{"_postman_id":"13e0a60b-9176-4b22-b9e9-4c091a76ffc1","name":"TimeTrex Workforce Management API Examples","description":"<html><head></head><body><p>TimeTrex Workforce Management API examples. </p>\n<p>For more information please see <a href=\"https://www.timetrex.com/workforce-management-api\">TimeTrex Workforce Management API Documentation</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"10223102","collectionId":"13e0a60b-9176-4b22-b9e9-4c091a76ffc1","publishedId":"SWTABegB","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"448CCB"},"publishDate":"2020-01-28T18:08:41.000Z"},"item":[{"name":"APIUserTitle->setUserTitle() [Add New]","event":[{"listen":"prerequest","script":{"id":"2e8dee3c-977d-4605-a61e-a08063dae51c","exec":["pm.globals.set(\"random_number\", Math.floor( Math.random() * 10000 ));"],"type":"text/javascript"}},{"listen":"test","script":{"id":"d425e9b3-505d-4a43-bd49-44d81ed2246c","exec":["let user_title_id = responseBody;","console.log('Existing User Title ID: '+ user_title_id);","pm.globals.set(\"user_title_id\",user_title_id );",""],"type":"text/javascript"}}],"id":"30dfd192-bd44-402e-9ec2-ed73a2eebf90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","type":"text","value":"{\"0\":{\"name\":\"TestTitle{{random_number}}\"}}\n"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIUserTitle&Method=setUserTitle&SessionID={{SessionID}}","description":"<p>Create a new UserTitle with a random name. If created successfully the ID of the newly created record is returned, otherwise a API result set showing specific error messages will be returned.</p>\n<p>This can be viewed in the web UI under Employee -&gt; Job Titles.</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIUserTitle"},{"key":"Method","value":"setUserTitle"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"30dfd192-bd44-402e-9ec2-ed73a2eebf90"},{"name":"APIUserTitle->setUserTitle() [Edit Existing Record]","event":[{"listen":"prerequest","script":{"id":"2e8dee3c-977d-4605-a61e-a08063dae51c","exec":["pm.globals.set(\"random_number\", Math.floor( Math.random() * 10000 ));"],"type":"text/javascript"}},{"listen":"test","script":{"id":"d425e9b3-505d-4a43-bd49-44d81ed2246c","exec":[""],"type":"text/javascript"}}],"id":"f0057c97-b3e7-4f13-bd1e-a054bd26a043","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","type":"text","value":"{\"0\":{\"id\": {{user_title_id}},\"name\":\"TestTitleModified{{random_number}}\"}}\n"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIUserTitle&Method=setUserTitle&SessionID={{SessionID}}","description":"<p>Edit the previously created UserTitle and change the name. If successfull, a API result set will be returned with a \"api_retval\" of TRUE.</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIUserTitle"},{"key":"Method","value":"setUserTitle"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"f0057c97-b3e7-4f13-bd1e-a054bd26a043"},{"name":"APIUserTitle->setUserTitle() [Edit Existing Record w/Error]","event":[{"listen":"prerequest","script":{"id":"2e8dee3c-977d-4605-a61e-a08063dae51c","exec":["pm.globals.set(\"random_number\", Math.floor( Math.random() * 10000 ));"],"type":"text/javascript"}},{"listen":"test","script":{"id":"d425e9b3-505d-4a43-bd49-44d81ed2246c","exec":[""],"type":"text/javascript"}}],"id":"616f3d25-354f-4527-a39b-11b2542bab4b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","type":"text","value":"{\"0\":{\"id\": {{user_title_id}},\"name\":\"ThisNameIsMuchTooLongAndShouldCauseAValidationErrorForDemonstrationPurposes...ThisNameIsMuchTooLongAndShouldCauseAValidationErrorForDemonstrationPurposes...ThisNameIsMuchTooLongAndShouldCauseAValidationErrorForDemonstrationPurposes...ThisNameIsMuchTooLongAndShouldCauseAValidationErrorForDemonstrationPurposes...ThisNameIsMuchTooLongAndShouldCauseAValidationErrorForDemonstrationPurposes...{{random_number}}\"}}\n"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIUserTitle&Method=setUserTitle&SessionID={{SessionID}}","description":"<p>Edit the previously created UserTitle and change the name to something invalid. API result set will return \"api_retval=FALSE\" and \"details\" specifying the exact field name and error message for that field.</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIUserTitle"},{"key":"Method","value":"setUserTitle"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"616f3d25-354f-4527-a39b-11b2542bab4b"},{"name":"APIUserTitle->getUserTitle() [Get All]","id":"08d7160a-9787-458c-8677-72c4de164282","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","value":"","type":"text"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIUserTitle&Method=getUserTitle&SessionID={{SessionID}}","description":"<p>Get all user titles</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIUserTitle"},{"key":"Method","value":"getUserTitle"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"08d7160a-9787-458c-8677-72c4de164282"},{"name":"APIUserTitle->getUserTitle() [Filtered By Name]","id":"8f3ea7e4-7a19-4147-9c5c-f428f1cee0bd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","type":"text","value":"{\"0\":{\"filter_data\":{\"name\":\"TestTitle\"}}}"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIUserTitle&Method=getUserTitle&SessionID={{SessionID}}","description":"<p>Filter UserTitles by name</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIUserTitle"},{"key":"Method","value":"getUserTitle"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"8f3ea7e4-7a19-4147-9c5c-f428f1cee0bd"},{"name":"APIUserTitle->deleteUserTitle()","event":[{"listen":"prerequest","script":{"id":"2e8dee3c-977d-4605-a61e-a08063dae51c","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"d425e9b3-505d-4a43-bd49-44d81ed2246c","exec":[""],"type":"text/javascript"}}],"id":"42b4a1e9-e459-4e46-aa5f-d0cc30fe4ad2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","type":"text","value":"{\"0\": [ {{user_title_id}} ]  }\n"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIUserTitle&Method=deleteUserTitle&SessionID={{SessionID}}","description":"<p>Delete the previously created UserTitle. This may return a permission denied error if permissions for deleting this record are not allowed. Otherwise it would return a API result set with \"api_retval=TRUE\"</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIUserTitle"},{"key":"Method","value":"deleteUserTitle"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"42b4a1e9-e459-4e46-aa5f-d0cc30fe4ad2"},{"name":"APIJob->setJob() [Add New]","event":[{"listen":"prerequest","script":{"id":"2e8dee3c-977d-4605-a61e-a08063dae51c","exec":["pm.globals.set(\"random_number\", Math.floor( Math.random() * 10000 ));"],"type":"text/javascript"}},{"listen":"test","script":{"id":"d425e9b3-505d-4a43-bd49-44d81ed2246c","exec":["let job_id = responseBody;","console.log('Existing Job ID: '+ job_id);","pm.globals.set(\"job_id\", job_id );",""],"type":"text/javascript"}}],"id":"0f9a10dc-45d6-4078-b09d-caf47a4fcc56","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","type":"text","value":"{\"0\":{\"name\":\"TestJob{{random_number}}\", \"manual_id\": \"{{random_number}}\"}}\n"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIJob&Method=setJob&SessionID={{SessionID}}","description":"<p>Create a new Job with a random name/code. If created successfully the ID of the newly created record is returned, otherwise a API result set showing specific error messages will be returned.</p>\n<p>This can be viewed in the web UI under Employee -&gt; Jobs.</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIJob"},{"key":"Method","value":"setJob"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"0f9a10dc-45d6-4078-b09d-caf47a4fcc56"},{"name":"APIJob->setJob() [Edit Existing Record]","event":[{"listen":"prerequest","script":{"id":"2e8dee3c-977d-4605-a61e-a08063dae51c","exec":["pm.globals.set(\"random_number\", Math.floor( Math.random() * 10000 ));"],"type":"text/javascript"}},{"listen":"test","script":{"id":"d425e9b3-505d-4a43-bd49-44d81ed2246c","exec":[""],"type":"text/javascript"}}],"id":"d62d9292-ac71-4ba4-b667-79a6ed706996","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","type":"text","value":"{\"0\":{\"id\": {{job_id}},\"name\":\"TestJobModified{{random_number}}\"}}\n"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIJob&Method=setJob&SessionID={{SessionID}}","description":"<p>Edit the previously created Job and change the name. If successfull, a API result set will be returned with a \"api_retval\" of TRUE.</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIJob"},{"key":"Method","value":"setJob"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"d62d9292-ac71-4ba4-b667-79a6ed706996"},{"name":"APIJob->deleteJob()","event":[{"listen":"prerequest","script":{"id":"2e8dee3c-977d-4605-a61e-a08063dae51c","exec":[""],"type":"text/javascript"}},{"listen":"test","script":{"id":"d425e9b3-505d-4a43-bd49-44d81ed2246c","exec":[""],"type":"text/javascript"}}],"id":"2b8b6775-f629-4f25-84b8-d7a84c61d9e8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"json","type":"text","value":"{\"0\": [ {{job_id}} ]  }\n"}]},"url":"https://demo.timetrex.com/next-release/api/json/api.php?v=2&Class=APIJob&Method=deleteJob&SessionID={{SessionID}}","description":"<p>Delete the previously created UserTitle. This may return a permission denied error if permissions for deleting this record are not allowed. Otherwise it would return a API result set with \"api_retval=TRUE\"</p>\n","urlObject":{"protocol":"https","path":["next-release","api","json","api.php"],"host":["demo","timetrex","com"],"query":[{"key":"v","value":"2"},{"key":"Class","value":"APIJob"},{"key":"Method","value":"deleteJob"},{"key":"SessionID","value":"{{SessionID}}"}],"variable":[]}},"response":[],"_postman_id":"2b8b6775-f629-4f25-84b8-d7a84c61d9e8"}],"event":[{"listen":"prerequest","script":{"id":"89ab7db7-9561-454b-9f11-0a71d656d211","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"97f27d9f-5a99-415f-a332-6b2d658e1cc3","type":"text/javascript","exec":[""]}}]}