{"info":{"_postman_id":"ab319747-5328-4a26-ac31-a159cb732c44","name":"LS2 Participant API","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"753798","collectionId":"ab319747-5328-4a26-ac31-a159cb732c44","publishedId":"RW8Aoonk","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2018-05-25T16:16:43.000Z"},"item":[{"name":"Participant Account Generation","event":[{"listen":"test","script":{"id":"d7ab59e4-380f-4729-9fa2-5b9dd125e37a","type":"text/javascript","exec":["var jsonData = JSON.parse(responseBody);","postman.setEnvironmentVariable(\"participantUsername\", jsonData.username);","postman.setEnvironmentVariable(\"participantPassword\", jsonData.password);"]}}],"id":"3904fa95-55f2-4af2-8d30-26aec5983e76","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"generator_id\": \"{{participantAccountGeneratorID}}\",\n\t\"generator_password\": \"{{participantAccountGeneratorPassword}}\"\n}"},"url":"{{baseURL}}/dsu/account/generate","description":"<p>This method generates a new participant account that can be used with the participant API\nGenerates a username and password that clients can exchange for a token via the Participant Log In method\nRequires a Generator ID and Password</p>\n","urlObject":{"path":["dsu","account","generate"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"3904fa95-55f2-4af2-8d30-26aec5983e76"},{"name":"Token Based Participant Account Generation","id":"09aa4483-6ab8-4662-b573-5a18d44e33ce","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","disabled":false}],"body":{"mode":"raw","raw":"{\n\t\"generator_id\": \"72831c6b-a542-42c7-b5f7-55ce5b428a1e\",\n\t\"token\": \"5K8_DyO-2O7mGXVn3OllyDhhxILjXfQPSNbW0SivDSu38db5Hq6nJiF-N5RNuZQ7xDmcvWnjI9bozOz6CCtIlQ\"\n}"},"url":"{{baseURL}}/dsu/account/generate/token","urlObject":{"path":["dsu","account","generate","token"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"09aa4483-6ab8-4662-b573-5a18d44e33ce"},{"name":"Participant Log In","event":[{"listen":"test","script":{"id":"8e56fc09-1ebd-4cad-b277-48a16398dfa5","type":"text/javascript","exec":["var jsonData = JSON.parse(responseBody);","postman.setEnvironmentVariable(\"participantToken\", jsonData.token);"]}}],"id":"7c1efa4d-ae09-4715-914d-8c511aaea01e","request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"{{participantUsername}}\",\n\t\"password\": \"{{participantPassword}}\"\n}"},"url":"{{baseURL}}/dsu/auth/token","description":"<p>This method authenticates participants\nExchanges a username / password combo for a token</p>\n","urlObject":{"path":["dsu","auth","token"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7c1efa4d-ae09-4715-914d-8c511aaea01e"},{"name":"Participant Token Check","id":"6b825c84-de2a-4350-858f-850ed11c0d72","request":{"method":"GET","header":[{"key":"Authorization","value":"Token {{participantToken}}"}],"body":{"mode":"formdata","formdata":[]},"url":"{{baseURL}}/dsu/auth/token/check","description":"<p>This method checks the validity of the token provided in the header</p>\n","urlObject":{"path":["dsu","auth","token","check"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6b825c84-de2a-4350-858f-850ed11c0d72"},{"name":"Add Datapoint","event":[{"listen":"prerequest","script":{"id":"fbdfd441-e1c2-498b-b952-a50cb9e81500","type":"text/javascript","exec":["postman.setGlobalVariable('timestampUtcIso8601', (new Date()).toISOString());"]}}],"id":"dcd4691c-1e93-4450-80e4-8b9d93cd4fc3","request":{"method":"POST","header":[{"key":"Authorization","value":"Token {{participantToken}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"header\": {\n\t\t\"id\": \"62ea4a47-e469-47de-ba60-9bc0192c199e\",\n\t\t\"schema_id\": {\n\t\t\t\"namespace\": \"com.curiosityhealth\",\n\t\t\t\"name\": \"postman_test\",\n\t\t\t\"version\": \"1.0.0\"\n\t\t},\n\t\t\"acquisition_provenance\": {\n\t\t\t\"source_name\": \"postman\",\n\t\t\t\"source_creation_date_time\": \"{{timestampUtcIso8601}}\",\n\t\t\t\"modality\": \"self-reported\"\n\t\t}\n\t},\n\t\"body\": {\n\t\t\"test_field\": \"272\"\n\t}\n}"},"url":"{{baseURL}}/dsu/dataPoints","description":"<p>This method is used to submit datapoints on behalf of a participant\nDatapoint must be a properly formatted OMH-style datapoint (see openmhealth.org)\nHeader is fairly rigidly structured, whereas body is schemaless\nRequires token to authenticate a participant</p>\n","urlObject":{"path":["dsu","dataPoints"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"dcd4691c-1e93-4450-80e4-8b9d93cd4fc3"},{"name":"Add Datapoint (Constant)","event":[{"listen":"prerequest","script":{"id":"fbdfd441-e1c2-498b-b952-a50cb9e81500","exec":["postman.setGlobalVariable('timestampUtcIso8601', (new Date()).toISOString());"],"type":"text/javascript"}}],"id":"9b4951b5-0abb-4535-9ec7-1181c54f8d72","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Token {{participantToken}}"},{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n    \"header\": {\n        \"acquisition_provenance\": {\n            \"modality\": \"sensed\",\n            \"source_creation_date_time\": \"2019-05-27T00:30:32-07:00\",\n            \"source_name\": \"edu.cornell.tech.productivitystudy\"\n        },\n        \"schema_id\": {\n            \"name\": \"logical-location\",\n            \"namespace\": \"cornell\",\n            \"version\": \"1.0.0\"\n        },\n        \"id\": \"5443146f-61a0-4e84-a0b2-e5e9ae7e1254\",\n        \"creation_date_time\": \"2019-05-27T00:30:28-07:00\"\n    },\n    \"body\": {\n        \"effective_time_frame\": {\n            \"date_time\": \"2019-05-27T00:30:28-07:00\"\n        },\n        \"action\": \"exit\",\n        \"location\": \"home_location\"\n    }\n}"},"url":"{{baseURL}}/dsu/dataPoints","description":"<p>This method is used to submit datapoints on behalf of a participant\nDatapoint must be a properly formatted OMH-style datapoint (see openmhealth.org)\nHeader is fairly rigidly structured, whereas body is schemaless\nRequires token to authenticate a participant</p>\n","urlObject":{"path":["dsu","dataPoints"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9b4951b5-0abb-4535-9ec7-1181c54f8d72"},{"name":"Participant Log Out","event":[{"listen":"test","script":{"id":"11d4987a-d912-4b6b-8d5a-fb543eb3269b","type":"text/javascript","exec":["postman.setEnvironmentVariable(\"participantToken\", \"\");"]}}],"id":"0b3056b8-497b-4ee5-8837-1ec9baf6f22e","request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[{"key":"Authorization","value":"Token {{participantToken}}"}],"body":{"mode":"formdata","formdata":[]},"url":"{{baseURL}}/dsu/auth/logout","description":"<p>This method can be used to log a participant out by invalidating the token</p>\n","urlObject":{"path":["dsu","auth","logout"],"host":["{{baseURL}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0b3056b8-497b-4ee5-8837-1ec9baf6f22e"}]}