Create Candidate Resource

Creating a candidate is the first step to placing a background check order.
To create a candidate you will be sending a [POST HTTP call to the /candidate resource] (https://accurate.readme.io/reference#postcandidate-1). The amount of information you provide when creating a candidate will vary depending on:

  • Your desired order workflow
  • The products in your packages
  • The amount of information you collect from your candidates in your app

📘

All calls require HTTP Basic Authentication

Let’s start by creating a candidate with the minimum amount of required information.

  1. Assemble the payload with the candidate’s first name, last name, and email address.

📘

POST calls can have content-type of application/x-www-form-urlencoded or application/json

  1. Send the payload along with your basic authentication credentials like this:
curl --request POST \ --url https://api.accuratebackground.com/v3/candidate \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{"firstName":"Elmer","lastName":"Fudd","email":"elmer@wb.com"}'
require 'uri' require 'net/http' require 'openssl' url = URI("https://api.accuratebackground.com/v3/candidate") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["Accept"] = 'application/json' request["Content-Type"] = 'application/json' request.body = "{\"firstName\":\"Elmer\",\"lastName\":\"Fudd\",\"email\":\"elmer@wb.com\"}" response = http.request(request) puts response.read_body
const options = { method: 'POST', headers: {Accept: 'application/json', 'Content-Type': 'application/json'}, body: '{"firstName":"Elmer","lastName":"Fudd","email":"elmer@wb.com"}' }; fetch('https://api.accuratebackground.com/v3/candidate', options) .then(response => console.log(response)) .catch(err => console.error(err));
import requests url = "https://api.accuratebackground.com/v3/candidate" payload = { "firstName": "Elmer", "lastName": "Fudd", "email": "elmer@wb.com" } headers = { "Accept": "application/json", "Content-Type": "application/json" } response = requests.request("POST", url, json=payload, headers=headers) print(response.text)
var client = new RestClient("https://api.accuratebackground.com/v3/candidate"); var request = new RestRequest(Method.POST); request.AddHeader("Accept", "application/json"); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\"firstName\":\"Elmer\",\"lastName\":\"Fudd\",\"email\":\"elmer@wb.com\"}", ParameterType.RequestBody); IRestResponse response = client.Execute(request);
<?php $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.accuratebackground.com/v3/candidate", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => "{\"firstName\":\"Elmer\",\"lastName\":\"Fudd\",\"email\":\"elmer@wb.com\"}", CURLOPT_HTTPHEADER => [ "Accept: application/json", "Content-Type: application/json" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; }
OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\"firstName\":\"Elmer\",\"lastName\":\"Fudd\",\"email\":\"elmer@wb.com\"}"); Request request = new Request.Builder() .url("https://api.accuratebackground.com/v3/candidate") .post(body) .addHeader("Accept", "application/json") .addHeader("Content-Type", "application/json") .build(); Response response = client.newCall(request).execute();
  1. Once a candidate resource is created successfully your response will include an ID for the candidate resource.

👍

Store the candidate ID so you can reference it when placing an order.

  1. You can append the candidate resource by using a [PUT HTTP call] (https://accurate.readme.io/reference#putcandidate-1). You must include the candidate ID at the end of the URL.

📘

PUT calls only support a content-type of application/x-www-form-urlencoded.

👍

Try it yourself!


What’s Next

Click here to read next tutorial for the next step.