API Documentation

Data at your fingertips

Authentication

You can generate the Token by POSTing the following URL and REQUEST body

URL

https://backend.diceflow.in/api-auth/

Sample Request body

"root":{

"username": "+919845611111"

"password": "p4$sw0rd"

"org_code": "MYORG"

}

Sample Response body

"root":{

"id":"+919845611111"

"code":"MYORG"

"token":"eyJhbGciOiJIUzI1NiIsInVCJ9.eyJzdWI......."

}

Workflows

You can use the Token generated above and bring down workflows in JSON format with the URL and REQUEST body, as specified below.

URL

https://backend.diceflow.in/api/workflows/

Header:

Authorization: The token to pass which identifies the user in the format, Bearer eyJhbGciOiJIUzI1NiIsInVCJ9.eyJzdWI.......

Sample Request body

"root":{

"filter":{

"workflowTypes": ["Add Member", "Update Member"],

"createdDate":{

"start":"2022-11-29"

"end":"2022-11-30"

}

"lastWorkedOnDate":{

"start":"2022-11-29"

"end":"2022-11-30"

}

}

"pageSize":20

"pageNumber":1

}


Filters available:

workflowTypes: List of workflow types you want to pull down 

createdDate: Dates between which the Workflows were created

lastWorkedOnDate: Dates between which the Workflows were last worked on, in terms of ONLY execution of workflow 

pageSize: Number of workflows to bring down per page

pageNumber: Number of pages of workflows to bring down

☞ Multiply pageSize by pageNumber to find the number of workflows which will be brought down.  Ideally, you should keep this number at a slightly larger count than current total number of workflows

Sample Response body

"root":[

0:{

"type":{

"id":"38edc83f-d804-4461-8862-c34470cddb12"

"name":"Diabetes RASTTA"

}

"status":{

"id":"0c826a7d-605f-4f50-abf5-682121fd2d38"

"name":"RASTTA completed"

"isTerminal":true

}

"user":{

"id":"584fe530-edd9-4f3b-90bc-592ac7e437db"

"name":"+919845611111"

}

"affiliation":{

"id":"3533fdab-7eba-41bb-8943-2e1edd9a6a46"

"affiliationType":"member"

}

"subtitle":"Member by WF Name"

"createdDate":"2023-06-16"

"lastUpdatedDate":"2023-06-16"

"isArchived":false

"previousOwners":[

0:"584fe530-edd9-4b-90bc-592bc7e437db"

]

"lastWorkedOnDate":"2023-06-16"

"dueDate":"2023-07-16"

"id":"00b8c2cd-2538-488a-98bb-a40a4fe162d"

"customFields":[

0:{

"fieldId":"5db4a5db-2d67-4609-abaf-42acccc6098f"

"value":"Ashley M wo Venki (KAAAC00XYZ / SHG: Sangha ) by FieldWorker Ashish"

"name":"Member by WF Name"

}

1:{

"fieldId":"96c84a-2aea-46dc-aa6c-6e59e0cff1e6"

"value":false

"name":"Pregnant"

}

2:{...}

3:{...}

]

}

]

Example using Curl commandline

Generate Auth Token

curl -X POST -d 'username=%2B919845611111&password=p4$sw0rd&org_code=MYORG' "https://backend.staging.diceflow.in/api-auth/"

Above command will respond with a Token for the specified account; Use the same in the call below to get 10000 Workflows (pageSize X pageNumber = 1000X10 = 10000) created between 1st April 2023 and 31 March 2024; Financial year of 2023-24 

Call Workflows API

curl -X POST -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6I_gdWIiOiJlMDk5ODI3MS0wZjE2LTQ2MTktODkzZC04Mjg4ZWY1ZGI4ZDUiLCJleHAiOjE3MTUyOTkyMDAsImlhdCI6MTcxMDE3MTUxMX0.kYWKjhg_fdblOGdmnV5gVkQA2npB2jukpXtErg_jYTRlG0" -H "Content-Type: application/json" -d '{ "filter": { "createdDate": { "start": "2023-04-01", "end": "2024-03-31" }, "lastWorkedOnDate": {} }, "pageSize": 1000, "pageNumber": 10 }' "https://backend.staging.diceflow.in/api/workflows/"