The Rest APIs is a hub for all your Rest API setups and it can be accessed from the main menu Data → Rest APIs. In this page you can easily manage the following:

  • Create OAuth2 authentications in the Authentications section;
  • apply any survey filter to the API response in the Outbound Filters section;
  • review all API calls made in the last 90 days in the Request History section.




Table of Contents






Authentications


The Authentications feature allows you to create and manage your OAuth2 authentications. Here you will be able to generate a Client ID and Client Secret that will be required when setting up an integration.




Feature notes:

  • When adding a new authentication the Global division will provide data from all divisions, while choosing a specific division will only provide send the data related to that division.
  • All information of an Authentication can be seen by clicking on its name. This include Client ID and Client Secret.






How to Authenticate via OAuth2


Our APIs support the OAuth2 authentication protocol. Using the OAuth2 protocol, you allow an external application to log into CustomerGauge to call one of our APIs. Contrary to traditional authentication through API keys, OAuth2 does not rely on a single API key that's shared across all kinds of applications. This gives you the big benefit of not having to back-track to every connected system to change your API key should you lose it.



1. Navigate to Data → Rest APIs Authentications.


2. Click on an authentication's name, the Authentication Details screen will show all the data related to it.


3. Reveal the Client Secret by clicking on the eye icon located on the right side. You will need both the Client ID and Client Secret.


4. Request the Access Token via:
Endpoint: 

https://auth.{{region}}.customergauge.com/oauth2/token

replace {{region}} by your platform's region, it can be .eu, .us or .au.


Grant type: client_credentials



Access Token Expiration: The Access Token stays valid for 1 hour after obtaining it, after which you'll need to obtain a new one.



cURL Example

curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=client_credentials&client_id={{Client ID}}&client_secret={{Client Secret}}" https://auth.{{region}}.customergauge.com/oauth2/token

Make sure to replace {{Client ID}}, {{Client Secret}}, and {{Region}} as applicable to your use case.



Calling APIs To call our APIs through OAuth2 authentication, you'll need to pass the Access Token with Bearer in the Authorization header of each request.

Authorization:Bearer eyJraWQiOiJJQXUwOWdhVjVZbDFuW...


You can call any of our Rest APIs and 4.1 APIs using this method of authentication






Adding New OAuth2 Authentication



1. Navigate to Data → Rest APIs → Authentications.


2. Click on +New Authentication button.


3. Type a descriptive name for your authentication.


4. Select a division to restrict the data or leave it as Global for unrestricted data.


5. Click on Save.




Editing Authentication



1. Navigate to Data → Rest APIs → Authentications.


2. Click on under Actions and then Edit.


3. Make all the changes you would like to and click on Save.






Inbound Mapping


The Inbound Mapping feature can be found navigating to Data → Rest APIs → Inbound Mapping and it is used for bringing data into CustomerGauge via our Rest APIs. With this feature you will be able to assign a label to multiple fields and choose the type of incoming data.





Adding New Mapping


1. Select Inbound Mapping in the Rest APIs menu.


2. Click on +New Mapping button.


3. Select the Data Type and fill the Configuration Name field.



4. On Field Mapping choose all the fields you want to import into the system and their Field Heading.



6. Click on the Save button to finish the mapping creation.




Editing Mapping


1. Navigate to Data → Rest APIs → Inbound Mapping.


2. Click on under Actions and then Edit.


3. Make all the changes you would like to and click on Save.


IMPORTANT: When editing a mapping, make sure to also apply any field heading changes to your API requests.




Generating Webhook from Mapping



1. Navigate to Data → Rest APIs → Inbound Mapping.


2. Click on under Actions and then Generate Webhook.


3. In the Generate Webhook screen, click on Save.


4. The Webhook will be generate and you'll be presented all its information.



5. If you want to view the information at a later date, do so from the Webhooks feature navigating to Data → Integrations → Webhooks.






Outbound Filters


The Outbound Filters feature allows you to create and manage filters that you can easily apply to the Survey Records Rest APIs. You can access this feature navigating to Data → Rest APIs → Outbound Filters.




Feature notes:

  • Currently this feature is supported only by the GET Responses and the GET Non-Responses  Rest APIs.
  • You are able to use the filters created with this feature by adding the parameter filter along with the filter reference in the API call.
    Example: filter=48515838-72e9-484f-a22a-10484a8cc2e9




Adding New API Filter



1. Navigate to Data → Rest APIs → Outbound Filters.


2. Click on +New API Filter button.


3. Type a descriptive name for your filter.


4. Click on +Add Filter and choose your desired survey filters.


5. Click on Save.


6. Add the filter parameter and filter reference to your API calls. Check GET Responses and the GET Non-Responses support pages for detailed information.




Editing API Filters



1. Navigate to Data → Rest APIs → Outbound Filters.


2. Click on under Actions and then Edit.


3. Make all the changes you would like to and click on Save.


IMPORTANT: When editing a filter, the filter reference will not change. Please, be aware that the API responses will apply the filter changes instantly to all API calls made with the same filter reference.






Request History


In the Request History section you are able to view all requests performed in the last 90 days and relevant information to identify them:

  • Method;
  • Domain;
  • Resources;
  • Client ID;
  • Happened At.






The search feature will look for matches across all pages. Currently it is possible to search for Domain, Resources and Status.