Quickstart
Get up and running with our API and start developing your AdSecure integration.
Integrating AdSecure into your app can begin as soon as you create a AdSecure account, requiring only 2 steps:
Obtain your API key so AdSecure can authenticate your integration’s API requests.
Make a test API request to confirm everything is up and running.
Obtain your API key
AdSecure authenticates your API requests using your account’s API key. If you do not include your key when making an API request, or use one that is incorrect or outdated, AdSecure returns an error.
Every account is provided with an API key. You can generate your own key by accessing your profile - API integrations. Some additional ones can be created by contacting your account manager. In our code examples, we include randomly generated API keys. Replace these with your own to see code examples being executed successfully.
If you don't have an account, please sign up for an account here(https://app.adsecure.com/auth/signup).
Make a test API request
To check that your integration is working correctly, make a test API request using your secret key to retrieve your User
's details.
curl -H 'x-api-key: nhwQ4taIgNciu3xrabY8BMFXAZGyYGtc8r' -d '
{
"query":"query { viewer { user { name }}}"
}' -X POST https://api.adsecure.com/graphql
AdSecure returns a User
object in response to your API request.
{
"data": {
"viewer": {
"user": {
"name": "Your user's name!"
}
}
}
}
Once you have successfully made an API request, you’re ready to begin integrating AdSecure.
Notes
For the rest of the documentation, we will show these cURL examples using a shorthand format that leaves out all the bits that are the same in every request, like the hostname, port, headers, and the cURL command itself. Instead of showing a full request like:
curl -H 'x-api-key: nhwQ4taIgNciu3xrabY8BMFXAZGyYGtc8r' -d '
{
"query":"query { viewer { user { name }}}"
}' -X POST https://api.adsecure.com/graphql
We will show it in this shorthand format:
query {
viewer {
user {
name
}
}
}
In fact, this format is the one used to represents a GraphQL query. If you're not familiar with GraphQL, please have a look to at its dedicated section in this documentation.