Quick Apply

Integration used for jobs where apply_method is easy_apply_endpoint and the number_of_questions_allowed is 0. Only the email, the full name and the Partner Attributes contained in the Job Search response are required.

Prerequisite

  • x-api-key: Token that is given to the partner to be able to use the API, and it must be added in the request headers.

Example Request

URL

Note: Check the /easy-apply documentation and remember to add in the headers the x-api-key.

https://partners.apploi.com/easy-apply

Body

{
    "applicant": {
        "email": "{{email}}",
        "fullName": "{{fullName}}",
        "phoneNumber": "{{phoneNumber}}",
        "resume": {}
    },
    "get_person_token": 1,
    "enqueue": true,
    "job": {
        "jobId": "{{job_id}}"
    },
    "partner_attributes": {
        "sponsored": true,
        "redirect_apply": "https://jobs-univision.apploi.com/view/468036?utm_campaign=integration&utm_medium=job-board-search&utm_source=<utm_source>-boosted&ajs_event=LOAD_JOB_PAGE&ajs_aid=3f617530-4530-11e9-a2ca-7e775511d9e3&ajs_prop_search_fetch_id=efb330ceef1b44e3b07328adae1b1ccd&ajs_prop_keyword=&ajs_prop_page=1&ajs_prop_city_center=Unselected&ajs_prop_search_order=5&ajs_prop_job_id=468036&ajs_prop_doc_type=preferredjob&ajs_prop_job_location_lat=39.3798123&ajs_prop_job_location_lon=-74.5302804&ajs_prop_boosted=1&ajs_prop_utm_source=<utm_source>-boosted&ajs_prop_utm_medium=job-board-search&ajs_prop_utm_campaign=integration",
        "utm_medium": "job-board-search",
        "utm_campaign": "integration",
        "keyword": "",
        "search_fetch_id": "efb330ceef1b44e3b07328adae1b1ccd",
        "page": 1,
        "order": 5,
        "city_center": "Unselected",
        "utm_source": "&lt;exploratory&gt;-quick-apply-boosted",
        "source": "&lt;source&gt;-apply"
    }
}

Request explained

ParameterValueDescription
get_person_token1Flag used to request a candidate JWT token, which will allow you to request some candidate information. Check Other useful endpoints
enqueuetrue
resumeJSON ObjectThe resume is optional, to check the entire structure go to /easy-apply

Examples

Applying to a Quick Apply job takes two calls. First, look the job up with /jobs/search. If its external_url is set, the employer takes applications on its own site, so send the applicant to its redirect_apply_url instead. Otherwise, check that its apply_method is easy_apply_endpoint. Then send the application to /easy-apply, with the job's id as a string and its partner_attributes unchanged.

Replace your_partner_name with the partner name agreed with Apploi.

The examples read your API key from an environment variable named APPLOI_API_KEY. Before running them, set APPLOI_API_KEY in your own environment to the Partner API key you received from Apploi. The examples do not set it for you, and the key should never be written into your code.

The examples leave out get_person_token, because the bearer token it returns belongs to the deprecated bearer-token flow. They send "enqueue": true, the default. Send false instead if you need to know straight away that the job has closed: the request then takes longer, and a closed job returns 412 instead of 200. For everything a response can mean, see What the response means on the /easy-apply reference page.

# APPLOI_API_KEY must hold the Partner API key you received from Apploi.
# These examples do not set it for you: set it yourself, in your own
# environment, before running them. For example, in your shell:
#   export APPLOI_API_KEY="<the API key you received from Apploi>"

# 1. Look up the job. Send the applicant to "redirect_apply_url" instead if
#    "external_url" is set. Otherwise check that "apply_method" is
#    "easy_apply_endpoint", and copy its "partner_attributes"
#    into the request in step 2.
curl -G https://partners.apploi.com/jobs/search \
  -H "X-Api-Key: $APPLOI_API_KEY" \
  --data-urlencode "job_id=468036" \
  --data-urlencode "source=your_partner_name"

# 2. Send the application.
curl -sS -X POST https://partners.apploi.com/easy-apply \
  -H "X-Api-Key: $APPLOI_API_KEY" \
  -H "Content-Type: application/json" \
  -w "\nHTTP status: %{http_code}\n" \
  -d '{
    "applicant": {
      "email": "[email protected]",
      "fullName": "Jane Doe",
      "phoneNumber": "555-010-0123"
    },
    "job": {
      "jobId": "468036"
    },
    "partner_attributes": {
      "sponsored": true,
      "search_fetch_id": "394f44dc0aff4ee6ae469221e8934ee8",
      "page": 1,
      "order": 2
    },
    "enqueue": true
  }'
import os

import requests

# APPLOI_API_KEY must hold the Partner API key you received from Apploi.
# These examples do not set it for you: set it yourself, in your own
# environment, before running them. For example, in your shell:
#   export APPLOI_API_KEY="<the API key you received from Apploi>"
API_KEY = os.environ["APPLOI_API_KEY"]

def submit_application(body):
    response = requests.post(
        "https://partners.apploi.com/easy-apply",
        headers={"X-Api-Key": API_KEY},
        json=body,
        timeout=60,
    )
    if response.status_code == 200:
        return "submitted", response.json()
    if response.status_code == 409:
        # The applicant has already applied to this job. Don't retry.
        return "already_applied", response.json()
    if response.status_code == 412:
        # Only sent when "enqueue" is False. Don't retry.
        result = response.json()
        if "job_id" in (result.get("errors") or {}):
            # The job is closed or doesn't exist.
            return "job_closed", result
        # The application already exists, for example from an earlier attempt.
        return "already_applied", result
    # 400: fix the request before sending it again. 5xx: retry with backoff.
    raise RuntimeError(f"Request failed with status {response.status_code}: {response.text}")

# 1. Look up the job, and check that it takes Quick Apply.
response = requests.get(
    "https://partners.apploi.com/jobs/search",
    headers={"X-Api-Key": API_KEY},
    params={"job_id": "468036", "source": "your_partner_name"},
    timeout=30,
)
response.raise_for_status()
jobs = response.json()["data"]
if not jobs:
    raise RuntimeError("Job 468036 was not found")
job = jobs[0]
if job.get("external_url"):
    # The employer takes applications on its own site.
    raise RuntimeError(f"Send the applicant to {job['redirect_apply_url']}")
if job["apply_method"] != "easy_apply_endpoint":
    raise RuntimeError(f"Job 468036 uses {job['apply_method']}, not Quick Apply")

# 2. Send the application.
outcome, result = submit_application({
    "applicant": {
        "email": "[email protected]",
        "fullName": "Jane Doe",
        "phoneNumber": "555-010-0123",
    },
    "job": {"jobId": job["id"]},  # a string, not a number
    "partner_attributes": job["partner_attributes"],  # sent back unchanged
    "enqueue": True,  # the default; False returns 412 straight away for a closed job
})
print(outcome, result)
// APPLOI_API_KEY must hold the Partner API key you received from Apploi.
// These examples do not set it for you: set it yourself, in your own
// environment, before running them. For example, in your shell:
//   export APPLOI_API_KEY="<the API key you received from Apploi>"
if (!process.env.APPLOI_API_KEY) {
  throw new Error("Set APPLOI_API_KEY to the Partner API key you received from Apploi");
}
const API_KEY: string = process.env.APPLOI_API_KEY;

type Outcome = "submitted" | "already_applied" | "job_closed";

async function submitApplication(body: object): Promise<{ outcome: Outcome; result: any }> {
  const response = await fetch("https://partners.apploi.com/easy-apply", {
    method: "POST",
    headers: { "X-Api-Key": API_KEY, "Content-Type": "application/json" },
    body: JSON.stringify(body),
  });
  if (response.status === 200) {
    return { outcome: "submitted", result: await response.json() };
  }
  if (response.status === 409) {
    // The applicant has already applied to this job. Don't retry.
    return { outcome: "already_applied", result: await response.json() };
  }
  if (response.status === 412) {
    // Only sent when "enqueue" is false. Don't retry.
    const result = await response.json();
    if (result.errors?.job_id !== undefined) {
      // The job is closed or doesn't exist.
      return { outcome: "job_closed", result };
    }
    // The application already exists, for example from an earlier attempt.
    return { outcome: "already_applied", result };
  }
  // 400: fix the request before sending it again. 5xx: retry with backoff.
  throw new Error(`Request failed with status ${response.status}: ${await response.text()}`);
}

// 1. Look up the job, and check that it takes Quick Apply.
const lookupParams = new URLSearchParams({ job_id: "468036", source: "your_partner_name" });
const lookupResponse = await fetch(`https://partners.apploi.com/jobs/search?${lookupParams}`, {
  headers: { "X-Api-Key": API_KEY },
});
if (!lookupResponse.ok) {
  throw new Error(`Request failed with status ${lookupResponse.status}`);
}
const job = (await lookupResponse.json()).data[0];
if (!job) {
  throw new Error("Job 468036 was not found");
}
if (job.external_url) {
  // The employer takes applications on its own site.
  throw new Error(`Send the applicant to ${job.redirect_apply_url}`);
}
if (job.apply_method !== "easy_apply_endpoint") {
  throw new Error(`Job 468036 uses ${job.apply_method}, not Quick Apply`);
}

// 2. Send the application.
const { outcome, result } = await submitApplication({
  applicant: {
    email: "[email protected]",
    fullName: "Jane Doe",
    phoneNumber: "555-010-0123",
  },
  job: { jobId: job.id }, // a string, not a number
  partner_attributes: job.partner_attributes, // sent back unchanged
  enqueue: true, // the default; false returns 412 straight away for a closed job
});
console.log(outcome, result);
require "json"
require "net/http"
require "uri"

# APPLOI_API_KEY must hold the Partner API key you received from Apploi.
# These examples do not set it for you: set it yourself, in your own
# environment, before running them. For example, in your shell:
#   export APPLOI_API_KEY="<the API key you received from Apploi>"
API_KEY = ENV.fetch("APPLOI_API_KEY")

def submit_application(body)
  uri = URI("https://partners.apploi.com/easy-apply")
  request = Net::HTTP::Post.new(uri)
  request["X-Api-Key"] = API_KEY
  request["Content-Type"] = "application/json"
  request.body = JSON.generate(body)

  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 60) do |http|
    http.request(request)
  end

  case response.code
  when "200" then [:submitted, JSON.parse(response.body)]
  # The applicant has already applied to this job. Don't retry.
  when "409" then [:already_applied, JSON.parse(response.body)]
  # Only sent when "enqueue" is false. Don't retry.
  when "412"
    result = JSON.parse(response.body)
    # With errors.job_id, the job is closed or doesn't exist. Otherwise the
    # application already exists, for example from an earlier attempt.
    (result["errors"] || {}).key?("job_id") ? [:job_closed, result] : [:already_applied, result]
  # 400: fix the request before sending it again. 5xx: retry with backoff.
  else raise "Request failed with status #{response.code}: #{response.body}"
  end
end

# 1. Look up the job, and check that it takes Quick Apply.
uri = URI("https://partners.apploi.com/jobs/search")
uri.query = URI.encode_www_form(job_id: "468036", source: "your_partner_name")
request = Net::HTTP::Get.new(uri)
request["X-Api-Key"] = API_KEY

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true, read_timeout: 30) do |http|
  http.request(request)
end
raise "Request failed with status #{response.code}" unless response.is_a?(Net::HTTPSuccess)

job = JSON.parse(response.body)["data"].first
raise "Job 468036 was not found" if job.nil?
# The employer takes applications on its own site.
raise "Send the applicant to #{job["redirect_apply_url"]}" if job["external_url"]
raise "Job 468036 uses #{job["apply_method"]}, not Quick Apply" unless job["apply_method"] == "easy_apply_endpoint"

# 2. Send the application.
outcome, result = submit_application(
  applicant: {
    email: "[email protected]",
    fullName: "Jane Doe",
    phoneNumber: "555-010-0123"
  },
  job: { jobId: job["id"] }, # a string, not a number
  partner_attributes: job["partner_attributes"], # sent back unchanged
  enqueue: true # the default; false returns 412 straight away for a closed job
)
puts outcome, result

Example Response

{
    "developer_message": "Submit Successful",
    "errors": null,
    "info": {
        "person_id": 32424609,
        "bearer_token": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MzI0MjQ2MDksInJvbGVzIjpbImFwcGxpY2FudCJdLCJleHAiOjE2MTMxNTgxMjF9.vQuM-HDaPliAW53RO0f99Ti9px6dOnIY_nBJAU4F-K0",
        "job_id": "598551"
    }
}

Status Code Response

  • 200 (Successful): The application was accepted. With the default "enqueue": true, a job that has closed also returns 200, and the application is then dropped.
  • 409 (Conflict): The applicant has already applied to this job, matched on email address. This happens unless the team has repeat applications turned on.
  • 412 (Precondition Failed): Only sent when "enqueue" is false. If errors has a job_id, the job is closed or doesn't exist; otherwise the application already exists.
  • 400 (Bad Request): The request is invalid, for example a missing email or fullName. developer_message says what's wrong.

See Errors for the other status codes.