Difference between revisions of "Get Form By Name and Username"
From MyMobileWorkers API
(Created page with "== Summary == {| border="1" class="wikitable" ! Forms ! colspan="2" | |- ! URL | colspan="2" | https://:base_url/:api_path/:version/forms/nameAndUsername?api_key=YOUR_KEY&n...") |
(→Summary) |
||
| Line 34: | Line 34: | ||
The Get Forms by Name and Username method returns all forms with a name matching the 'name' parameter and with an assigned mobile user with a username matching 'username'. | The Get Forms by Name and Username method returns all forms with a name matching the 'name' parameter and with an assigned mobile user with a username matching 'username'. | ||
A start_date and end_date can be specified if required. | A start_date and end_date can be specified if required. | ||
| + | |||
| + | == Example response == | ||
| + | |||
| + | <source lang="java"> | ||
| + | { | ||
| + | "forms" : [ | ||
| + | { | ||
| + | "created_at": "2020-02-20T14:39:37+00:00", | ||
| + | "name": "test", | ||
| + | "id": 1, | ||
| + | "notes": null, | ||
| + | "mobileUserId": { | ||
| + | "username": "Test User", | ||
| + | "external_id": "", | ||
| + | "color": "3B0AA3", | ||
| + | "uat": false, | ||
| + | "engineer_registration_number": null, | ||
| + | "email": "", | ||
| + | "panicked": false, | ||
| + | "lastInternetConnection": null | ||
| + | }, | ||
| + | "vehicle": null, | ||
| + | "updated_at": "2020-02-20T14:39:40+00:00", | ||
| + | "checklist": [ | ||
| + | { | ||
| + | "created_at": "2020-02-20T14:39:36+00:00", | ||
| + | "name": "test", | ||
| + | "linked_uuid": null, | ||
| + | "checklist_questions": [ | ||
| + | { | ||
| + | "notes": null, | ||
| + | "question": "Question1", | ||
| + | "answer": "Answer1" | ||
| + | }, | ||
| + | { | ||
| + | "notes": null, | ||
| + | "question": "Question2", | ||
| + | "answer": "Answer2" | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | ] | ||
| + | } | ||
| + | </source> | ||
| + | |||
| + | == Example curl request == | ||
| + | |||
| + | curl "https://api.mymobileworkers.com:8181/api/1/forms/nameAndUsername?api_key=YOUR_KEY&name=TestForm&username=TestUser&start_date=2015-05-07%2012:50:44&end_date=2015-06-08 12:50:44" | ||
Revision as of 13:23, 5 April 2020
Summary
| Forms | ||
|---|---|---|
| URL | https://:base_url/:api_path/:version/forms/nameAndUsername?api_key=YOUR_KEY&name=FORM_NAME&username=USERNAME&start_date=DATETIME&end_date=DATETIME | |
| Type | GET | |
| Params: | api_key | required |
| name | required | |
| username | required | |
| start_date | ||
| end_date | ||
| Response | JSON | |
The Get Forms by Name and Username method returns all forms with a name matching the 'name' parameter and with an assigned mobile user with a username matching 'username'. A start_date and end_date can be specified if required.
Example response
{ "forms" : [ { "created_at": "2020-02-20T14:39:37+00:00", "name": "test", "id": 1, "notes": null, "mobileUserId": { "username": "Test User", "external_id": "", "color": "3B0AA3", "uat": false, "engineer_registration_number": null, "email": "", "panicked": false, "lastInternetConnection": null }, "vehicle": null, "updated_at": "2020-02-20T14:39:40+00:00", "checklist": [ { "created_at": "2020-02-20T14:39:36+00:00", "name": "test", "linked_uuid": null, "checklist_questions": [ { "notes": null, "question": "Question1", "answer": "Answer1" }, { "notes": null, "question": "Question2", "answer": "Answer2" } ] } ] } ] }