Fetching Goal Metrics
Overview¶
Giosg platform provides APIs for fetching metrics from the Goals (previously) active. This tutorial guides you through requesting the goals within the organization, for use in your own application.
Prerequisites¶
A guide on how to create an API token can be found here
Once you have obtained your API token(s), define the Authorization HTTP header for all your API requests:
1 |
|
You should replace the
<api_key>
with your API token
Remember that the api token is connected to the user that created the token, which means that if the user is deleted the api token will also be invalidated. You can create an extra user and create the token with this user, remember to name the user so that it doesn’t get deleted by mistake e.g “Reporting api-user do not delete”
Gather your goal ids¶
Once you start fetching your goal metrics you will need to gather your goal ids. This you can do through the Goals API. Then we need to get the appropriate metrics from the new API.
Getting your metrics¶
POST https://api.giosg.com/api/reporting/workflow/v1/orgs/<organization_id>/query/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
If you fetched the above metrics you will receive a result like the following, which will give you all goal metrics in the active time:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|
Conclusion¶
In this tutorial we have learnt how to fetch all goal metrics in a specific timespan. If you have more questions feel free to E-Mail support@giosg.com
or chat with us.