Our REST API is a powerful tool which allows you to gather data and process it depending on your needs. We have both the documentation and an API call tester embedded here.
This example will show you how to get the actions and reached users per campaign on the app specified by the resourceKey. This is using the analytics module of the MOCA V2 REST API.
What do you need?
- The resourceKey (it's the resource identifier. Can be App, place, etc).
- A valid Access Token (The API uses OAuth 2.0).
- The domain to be used (in this demo we use the campaign domain. Use https://api.mocaplatform.com/v2/analytics/domains/ to get the list domains).
- The metrics to be received (columns).
- The dimensions to be received (rows).
- The interval that contains the data.
- Go to https://developer.mocaplatform.com/docs/moca-api-analytics-query, scroll down and use our Try It Out module.
- Add the token to the tester. You must click on the key symbol and add the Access Token. If you do not have one, please contact support and request it.
- Next step is adding the resource key. In this case we will use the App Key you will find in the MOCA console settings under API Keys.
- Now add the domain. Let's use the campaign domain.
- The metrics per domain are seen when using the following call: https://api.mocaplatform.com/v2/analytics/domains/<domain>. For this example we use reached_users and actions.
- The dimensions also appear in the same response. We'll use campaign and app:version.
- The interval to be used in this case is last7days.
- Now Try it!
The MOCA REST API will give you JSON formatted data containing what you requested. You'll get the reached users, amount of times opened and both the App version and Campaign name for that App. With minor tweaks (replace reached_users for actions_opened and delete App:version) and minimal data processing (actions_opened divided by actions) you can get a Click Through Rate for your campaigns and experiences.
You can check other Dimensions, with their own metrics and Filters in order to gather meaningful insights that might not yet be available in our Console. Here you have an interesting example on how to gather Behavioral Tags per User:id.
Please note the REST API is only available if your licence includes a REST API Token. If you are interested in receiving your Token please contact your MOCA Account Manager.