API Tools in Control Center

Using the API tools to explore and use the API

API Tools

API Clients

The first step to interacting with the PredictHQ API is to create an API Client. You can do this from the API Clients section in Control Center.

alt

Under API Clients, select "New Client" or the "+" button. Give the API Client a title, description, select which scopes the token will have access to and save. Your API Client will be created, and credentials generated for it.

Remember: You MUST save the secret somewhere, as you won't be able to see it again.

alt

Now that you have an API Client you can generate a token for it. When viewing the Client, select "Create an access token". You can give the token a description and select which scopes the token will have access to. To complete this guide your token will need to have the "Events" scope, but the others are optional.

After entering the client secret you saved earlier, select "Create new token" and save the generated token somewhere - as with the client secret, you won't be able to see it again within Control Center.

Remember: You MUST save the token somewhere, as you won't be able to see it again.

alt

After creating the client it shows in your list of clients.

alt

Now you have an API client you can call the API. See https://docs.predicthq.com/ for more details. You can also use the API Explorer feature of Control Center to explore the capabilities of the API.

API Explorer

Clicking on API explorer in the left navigation menu will allow you to explore the capabilities of the API and generate code.

alt

Note: Using an API Access token is optional since you're already logged in.

Now choose the parameters you want to search, filter, or sort on to find the events that impact you. Click on view code to generate code to copy and paste to get a POC up and running quickly.

Click on "run now" to run your API query and see the results.

alt

Choose from the list of endpoints at the top of API Explorer to explore the API for each.

alt