Using the UI Claimant API

AJL's UI Claimant API (Application Programming Interface) is a real-time RESTful web service that uses JSON for data interchange. It processes claimant information sent from a state’s UI system, automatically creating a JobLink account, UI enrollment, and Self-Service enrollment if one does not exist; or updating the claimant record in JobLink if one does exist. This begins a process of notifications between JobLink and UI of claimant activity, as well as job match notifications to the job seeker.

UI agencies must develop, purchase, or use an open-source RESTful client to use the API. Using the Claimant API requires basic knowledge of software development and web services. The UI Claimant API is secured using an API token. The UI agency's IT staff who are implementing the API must be given the token by the state's AJL administrator. The API token is the same whether the Staging (Test) or Production endpoint are being used.

Viewing an API Token

The following instructions are for the state’s AJL administrator.

  1. Log into AJL as an administrator.

  2. Click Admin Tasks in the navigation bar.

  3. On the Admin tab of Admin Tasks, scroll down to the bottom of the page and click the API tile. The UI Claimant API is displayed next to /api/ui_claimants.

  4. Provide the token in a secure manner (such as encrypted email) to the IT staff responsible for implementing the UI Claimant API.

How the UI Claimant API Works

To use the UI Claimant API, you need a RESTful client, which is a program that lets you build

HTTP requests. To make a request, you need to include the URL, Header, Method, and Body.

Request URL

An endpoint is a unique URL that makes up part of an API. For the UI Claimant API, each state using AJL has two unique endpoints: one for the Staging (Test) environment and one for the Production environment. The state AJL administrator should provide the UI IT staff with these endpoints. Any testing using the Production endpoint should be coordinated with the state AJL administrator.

Method

There is only one method for the UI Claimant API: POST.

Header

Headers provide meta information about the request. Add the following headers to your RESTful client:

UI Claimant API Headers
Header Name Header Value
Content-Type application/json
Accept application/json
Authorization Token token=”provided api key”

Body

The request body contains the UI claimant data the client is sending to the AJL server. UI sends a RESTful request when a person files a new claim or an additional claim. A successful request creates an UI enrollment and job seeker account in AJL if they don't already exist. Otherwise, it updates appropriate claim and account information.

About UI Claimant API Data

The following table provides the keys and values accepted in the body of UI Claimant API requests. There are four types of data: string (group of characters and digits), integer (group of digits), boolean (true or false), and semi-boolean (no, yes, not reported). Accepted values are provided, as well as any constraints, such as character limits.

General Data Formatting Guidelines

  • When data is to be inserted as null, send a null value.

  • When a data element is not provided at all, no value is set (i.e., omitted data elements are not assumed to be null).

  • The integer value 99 is only equivalent to null for fields of type "semi-boolean". Semiboolean values of 99 or null are recorded as 99 in their associated database field. This value is used for when the user opts-out of providing information, not to indicate that a question was never asked.

  • Date (Time) fields are ISO 8601 may be formatted as follows (examples):

    • "2014-12-31" (if time is included "2014-12-31T04:05:06+07:00").

    • "2014/12/31" (if time is included "2014/12/31T04:05:06+07:00").

    • "20141231" (if time is included "20141231T040506+0700").

    • "31st Dec 2014" (if time is included "31st Dec 2014 04:05:06 PM").

Notes

  • All of the following must be true in the request in order for the TSM (Transitioning Service Member) tag to appear on a job seeker's Case Details page:

    • "is_veteran" = true

    • "end_date" = a future date

    • upcoming_separation" = 1 OR "upcoming_retirement" = 1

    • "tap" = 1

  • All of the following must be true in the request in order for the TSM (Transitioning Service Member) tag to appear on the Job Seeker Search page for a job seeker:

    • "is_veteran" = true

    • "end_date" = a future date

    • upcoming_separation" = 1 AND/OR "tap" = 1

  • If a claimant's contact information is updated via the API and the "country" field is empty in the request, the updated contact information will not override the existing country_id. If the existing claimant's country_id is null, it is defaulted to United States.

  • (Idaho only) If an API request includes a claimant that is already in the system and the claimant is identified as a veteran in the request but not in JobLink (or vice versa), the claimant's veteran status is not updated in JobLink and no error will occur.

Submitting a Successful API Request

Using your RESTful client, send a request to the UI Claimant API endpoint. To be successful, all requests must include a valid API token and accepted values for all of the required fields as shown in the table above. They must also not trigger any data validation errors.

The API processes successful requests immediately. Matching against existing AJL job seeker records is based solely on the SSN provided in the request. If no matching SSN is found, a new AJL job seeker “stub account” is created for the claimant, as well as a username and a temporary password. AJLA–TS returns this log in information to the UI agency in the API response (See API Responses below for more information). The UI agency is responsible for communicating the AJL log in information to the claimant either by displaying it to them on a screen in the UI system, or by including the information in a letter or email to the claimant. AJLA–TS creates claimant usernames in the following format: 1st 3 characters of first name, 1st 3 characters of last name, then a special character and a sequential number: e.g. BroPat!73. The claimant’s temporary AJL password is their SSN. Never display the claimant’s actual SSN on a screen in the UI system or in a letter or email. Instead, use language such as “Your AJL password is your SSN.” The claimant will be required to reset their password upon first logging into AJL.

When an update to an existing record comes through the UI interface, the user’s username and password will remain their current AJL username and password, unless reset_password is set to “true” in the request (not recommended). Their account will be set to active if it was previously disabled for inactivity.

The full business logic executed in AJL for successful requests is shown below.

  • Updates the client's unended UI {Enrollment} and associated {UiBenefitInfo#is_job_match_exempt} status

    • Inactivates the {Enrollment}'s {ProgramParticipation} if {claim_job_match_exempt} is true

    • Adds a new 'Self Service' {Enrollment} if the client is not actively enrolled or inactivates the existing 'Self Service' {Enrollment}'s {ProgramParticipation} if {claim_job_match_exempt} is true.

  • If an active UI {Enrollment} exists:

    • {Enrollment#updated_at} is updated to the current date

    • If there already exists a {UiBenefitInfo} record for the associated UI {Enrollment}, and {UiBenefitInfo#is_job_match_exempt} is not equal to {claim_job_match_exempt}, then the {ProgramParticipation#inactivated_at} associated with the UI {Enrollment} is updated to either the current date/time or null depending on whether the value of {claim_job_match_exempt} is true or false, respectively

    • If {claim_byb} and {claim_bye} are not blank and they're not equal to {UiBenefitInfo#benefit_year_begins_on} and {UiBenefitInfo#benefit_year_begins_on} on the existing UI {Enrollment}, then:

      • {Enrollment#ends_on} and {ProgramParticipation#ends_on} are updated to the day preceding {claim_byb} if {UiBenefitInfo#benefit_year_ends_on} is greater than {claim_byb} and {claim_byb} is greater than {UiBenefitInfo#benefit_year_begins_on} and {claim_bye} is greater than {UiBenefitInfo#benefit_year_ends_on}

      • Otherwise, {Enrollment#ends_on} and {ProgramParticipation#ends_on} are updated to the value of {UiBenefitInfo#benefit_year_ends_on} if {claim_byb} is greater than {UiBenefitInfo#benefit_year_ends_on} and {claim_byb} is greater than {UiBenefitInfo#benefit_year_begins_on} and {claim_bye} is greater than {UiBenefitInfo#benefit_year_ends_on}

      • Otherwise, {UiBenefitInfo#benefit_year_begins_on} and {UiBenefitInfo#benefit_year_ends_on} are updated to {claim_byb} and {claim_bye}, respectively

    • If an active UI {Enrollment} doesn't exist or was closed out by the preceding logic, then:

      • The Process_CreateOnePgmEnroll stored procedure is run to create a new UI {Enrollment} for the client

      • A {UiBenefitInfo} record is created for the {Enrollment} above with the values of {claim_byb} and {claim_bye} for {UiBenefitInfo#benefit_year_begins_on} and {UiBenefitInfo#benefit_year_ends_on}, respectively

API Responses

After submitting a request, AJLA–TS will send a response back to UI including a status code indicating the success of the request.

  • 200: “successful” The request was successful, resulting in the execution of the business logic described above.

  • 401: “unauthorized” The request contained an unauthorized/invalid token in the HTTP header, and access is denied.

  • 404: “not found” Request may not have reached the UI claimants endpoint. Likely a transient network issue on the UI agency’s side.

  • 422: “unprocessable entity” The request was invalid and validation messages are provided.

  • 500: “internal server error” An error indicating a general problem on our server during specific steps in processing.

  • 502: “bad gateway” Likely a network issue on the UI agency’s side.

  • 503: “service unavailable” Request may not have reached the UI claimant’s endpoint. Likely a transient network issue on the UI agency’s side.

When a request is successful and no existing AJL job seeker account is found for the claimant, the response will also include the claimant’s AJL username and temporary password as discussed above in Submitting a Successful API Request, as well as a unique Participant ID. If the request includes a valid job title and a matching O*NET occupation code is found, the response will include the O*NET code and a job search link with the job title pre-filled in the search keyword field.

Example:

{
"username": "JohDoe!1"
"password": false [for first time user]/ true [for updated user],
"participant_id": 123456,
"onet_code": "35-9021.00",
"job_matches": {
"url": "https://[State URL]/search/jobs?keywords=Dishwasher"
}
}

Logging and Troubleshooting

It is critical that the UI agency implement logging according to state and agency procedures to record requests made and responses received through the UI Claimant API. Without logging, issues cannot be effectively researched and resolved. SSN is generally not needed for troubleshooting, so these can be omitted from logs for the protection of PII. The UI agency should monitor logs for any error status codes so that these can be promptly addressed without causing a delay in claimant benefits or other services.

Validation Errors

The most common errors are 422 (data validation) errors. The UI agency should work to resolve data validation issues for requests that receive a 422-error response, which may require reaching out to the claimant and/or AJL subscribing agency. The error response includes the information necessary to research and resolve the error; for example:

7/23/19: ClaimID: 1234567<BR/><BR/><BR/>Exception: The remote server returned an error: (422) Unprocessable Entity.<BR/><BR/>Response Text:

{"eligibility":{"veteran":{"is_veteran":["cannot be false since this client is already registered as a veteran"]}}}<BR/><BR/>

This error indicates the claimant already has an account in AJL with an is_veteran status of true, and the POST request includes an is_veteran status of false. The conflicting data must be resolved and then the POST request should be resent.

Network-Related Errors

404, 502, and 503 errors are all likely network issues on the UI agency side. UI should work with their IT resources to research these errors and attempt to resend the failed records at least once before reaching out to the AJL state administrator who would then contact AJLA–TS.

500 errors indicate a server/network issue on the AJLA–TS side. Before contacting the AJL state administrator, the UI agency should resend requests that receive a 500-error response once to see if it is an intermittent issue, such as a temporary DB timeout. If the request receives a 500 error a second time, report this to the AJL state administrator who will enter a ticket in the AJLA–TS issue tracking system. The ticket should include the approximate timestamp and first and last name of the claimant.

API requests will not be successful during AJL system downtime, such as scheduled releases, and will receive a 500-error response. Scheduled downtime should be communicated to the UI agency by the AJL state administrator. If possible, the UI system should be programmed to not send records during these timeframes. Alternatively, failed records should be sent as soon as possible after releases.