Send your first request

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

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:‌

  • Human resources endpoints start with /hr/v1/

  • Property management endpoints start with /api/v2/

‌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.

  • Choose the URL that corresponds to your industry to continue:

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

Get your API key

  • Replace <token> with your API key in the following header:

{ "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

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": "<number>", [...] "report_status": "ANALYZING", [...]

pageRetrieve the results

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:‌

  • Some required fields are missing in your request

"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:‌

  • You sent your request without an authorization header

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

  • You sent your request with an authorization header, but without an API Key

  • You provided an incorrect API key in the header of your request

"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:

  • You sent your request to an endpoint you don't have access to

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

How to fix this issue

Use the URL that corresponds to your industry.

pageError codes

Last updated