NAV Navbar
shell

Introduction

Welcome to the Trustcruit Create Candidate API Reference.

Create Customer

Redirect the user to:

https://example.com/customer/create/?callback=&customer_name=

GET Parameters

Parameter Type Description
callback Url Required. The callback url to which the autentication code will be sent to.
customer_name String Optional. The customer name to be auto filled.

The user will setup it's account on Trustcruit. Once completed, the user will be redirected back to the callback with a sprancher_id and an auth token.

Submit Candidate

HTTP Request

POST https://api.trustcruit.com/feedback/api/candidate/

(url must end with a / otherwise a 301 redirect will be returned)

HTTP Request Headers

Header Value
Accept application/json
Content type application/json

JSON Request Data

Example

{
  "customer_sprancher_id": 1010,
  "candidate_level": "step1",
  "candidate_email": "mathilda@bahoo.com",
  "job_ad_title": "Apprentice Hitman",
  "tags": [
    {
      "Recruiter name": "Leon",
      "Department": ["HR", "Hitman"],
      "City": "Little Italy"
    }
  ]
}
Parameter Type Description
customer_sprancher_id Number Required. Returned in the callback url after the user created an account on Trustcruit. When testing use 1010 as a test customer.
candidate_level String Required. Explained more into detail in the Candidate levels section. When testing use "test step" as a test level.
candidate_email String Required
job_ad_title String Optional
tags Object Optional
date String (YYYY-MM-DD) Optional. This is the interview date in step 2. If you send step 3, it is the day that the employment contract is signed and for step 4 it is the first day of employment. This field will be ignored in step 1.

Popular tag keys:

Tag example: Single value for tag

{
    "customer_sprancher_id": 1010,
    "candidate_level": "step1",
    "candidate_email": "foobar@example.com",
    "tags": {
        "City": "Stockholm"
    }
}

Tag example: Multiple values for tag

{
    "customer_sprancher_id": 1010,
    "candidate_level": "step1",
    "candidate_email": "foobar@example.com",
    "tags": {
        "City": ["Stockholm", "Jönköping"]
    }
}

Get customer stats

HTTP Request

GET https://api.trustcruit.com/shinyform/api/answers/stats/?question=405

GET Parameters

Parameter Type Description
question Number Required. Look at the Question number table below
date__gte Date (YYYY-MM-DD) Optional. Filter stats from the date (including)
date__lt Date (YYYY-MM-DD) Optional. Filter stats until the date (excluding the date)
tags__[key] String Optional. Filter stats on a certain tag (e.g. Project, Area). Example: tags__Project=Accounting

Question numbers

Number Description
405 CNPS

JSON Response Data

Example

[
  {
    "question": 405,
    "stats": {
      "2": 80,
      "0": 102,
      "9": 3037,
      "6": 497,
      "5": 654,
      "7": 1497,
      "10": 9337,
      "1": 81,
      "8": 3703,
      "3": 125,
      "4": 142
    },
    "count": 19255
  }
]
Parameter Type Description
question Number Question id
stats Object Goes from "0" to "10" The total amount of people who selected a certain answer. From this the CNPS can be calculated. Missing rating answers will be omitted.
count Number The total amount of answers.

Response will be an empty list if no data is available.

From the "stats" the CNPS can be calculated as following:

# Calculating CNPS

demoters = sum(stats.get(n, 0) for n in ["0", "1", "2", "3", "4", "5", "6"])
promoters = sum(stats.get(n, 0) for n in ["9", "10"])
total = sum(stats.values())

if total > 0:
    cnps = round(100 * (promoters - demoters) / total, 0)
else:
    print("CNPS unavailable")

Candidate levels

The following codes is activated for most customers:

Step Activated at
step1 After a candidate has submitted an application. This is not triggered when a candidate is copied or duplicated.
step2 After the candidate has been on an interview.
step5 After the candidate is rejected for a job possition.