Send your first request | Certn API v 1.0 | Certn

For the complete documentation index, see llms.txt. This page is also available as Markdown.

To follow this guide, you need a demo account. Make sure it's fully setup! If not, follow our instructions on how to create a demo account.

Request

To communicate with our API, you'll need to build HTTP requests. You can use the programming language of your choice to achieve this. We provide examples of scripts using Python, but most of the content you'll work with will be in JSON!

Get the URL

You can find the URLs for all our endpoints in the API Reference section of this documentation. Knowing how to use them can be helpful, so we'll show you how they're created.

In this example, you'll be making calls to our demo environment, at https://demo-api.certn.co.

We currently divide our endpoints by industry:

Later on, you'll request a Softcheck, which is under /applications. You'll also make it a quickscreen, so you'll be filling all of the information yourself instead of sending it to your applicant. To make it a quick screen, add /quick to your URL.

Place this together, and you get the URL for your call:

Human Resources

"https://demo-api.certn.co/hr/v1/applications/quick/"

Property Management

"https://demo-api.certn.co/api/v2/applications/quick/"

Get your API key

To gain access to our API, you need an Authorization header with a valid Bearer token. The token is your API key.

{ "Authorization": "Bearer <token>" }

Include this header in every call to our API, and keep it secure. It is your access key.

Add the content

  1. To request a Softcheck, add the request-flag 'request_softcheck': true to your content.
  2. For your applicant, use our CEO's name, Andrew McLeod.
  3. For the address, use our office location in Victoria, BC.
  4. Fill the SIN/SSN number with a placeholder.
{
    "request_softcheck": true,
    "information": {
            "first_name": "Andrew",
            "last_name": "McLeod",
            "addresses": [
                    {
                            "address": "1006 Fort St Unit 300",
                            "city": "Victoria",
                            "province_state": "BC",
                            "country": "CA"
                    }
            ],
            "sin_ssn": "123456789"
        },
}

Send the request

Now we're ready to bring it all together. Our /application endpoint accepts POST requests, so make sure that is what you use.

Here is what your full script may look like when using Python:

import requests

### Replace <token> with your API Key
headers = { "Authorization": "Bearer <token>" }

### Replace <URL> with the URL that corresponds to your industry
url = "<URL>"

content = {
    "request_softcheck": True,
    "information": {
            "first_name": "Andrew",
            "last_name": "McLeod",
            "addresses": [
                    {
                            "address": "1006 Fort St Unit 300",
                            "city": "Victoria",
                            "province_state": "BC",
                            "country": "CA"
                    }
            ],
            "sin_ssn": "123456789"
        },
}

# Sends the HTTP request to the API via POST
response = requests.post(url, headers=headers, json=content)

############### Optional ###############

# Brings errors to the forefront
response.raise_for_status()

# Writes the contents of the response in a file named "softcheckDemo.json"
with open("softcheckDemo.json", "w") as f:
    f.write(response.text)

############# End Optional ##############

In the previous example, we saved the results of the call to a new file named softcheckDemo.json.

With everything set properly and a good internet connection, you should receive a response status of 201 Created.

201 Created

[...]{"id": "", [...]
"report_status": "ANALYZING",
[...]`

Errors

Errors are a relatively common occurrence when working with APIs. It's always good to know how to prevent them and what to do when they arise.

Here are some errors you may encounter when doing this exercise, and how to fix them.

400 Bad Request

You may receive a 400 Bad Request when:

"information": {
     "addresses": ["This field is required."]
}

How to fix this issue

Add the missing fields to the body of your request and verify your syntax.

401 Unauthorized

You may receive a 401 Unauthorized if:

"detail": "Authentication credentials were not provided."
"detail": "Invalid token."

How to fix this issue

Add your API key in the authorization header, and include it in every call.

403 Forbidden

You may receive a 403 Forbidden if:

"detail": "You do not have permission to perform this action."

How to fix this issue

Use the URL that corresponds to your industry.

Error codes