Banner: Web API: List State Resources

Web API: List State Resources

List State Resources

The 'List State Resources' Web API enables developers to query and retrieve a list of State Resources by state. Resources are based on selected audience types found below, and focus on employment.

About this data

This Web API is used in several CareerOneStop sites to allow customers access to lists of state resources based on their selected audience, focusing on employment. Currently, state resources are available for audiences including: job seekers, businesses, ex-offenders, veterans, youth, and people experiencing unemployment. Please note that unemployment is a special use. The data provided for the unemployment "audience" option is contact information about that state's unemployment insurance program, as seen here.

As one example, here you can see the Business Center State Resource Finder. For more information about the data used in the Business Center State Resources pages, see that tool's Help Page. As another example, State Resource Finder on our main portal offers employment resources for a general audience.

Resource URL

https://api.careeronestop.org/v1/stateresources/{userId}/{state}/{audience}/{startRecord}/{limitRecord}

Example Code

using System;

using System.Net.Http;

using System.Net.Http.Headers;

using System.Threading.Tasks;

namespace CareerOneStopAPISample

{

    class Program

    {

        static void Main(string[] args)

        {

            CreateRequest().Wait();

        }

        private static async Task CreateRequest()

        {

   

            var uri = new UriBuilder(Uri.UriSchemeHttps, "api.careeronestop.org")

            {

                Path = "/v1/stateresources/{userId}/{state}/{audience}/{startRecord}/{limitRecord}"

            };

           

            using (var http = new HttpClient())

            {

                http.DefaultRequestHeaders.Accept.Clear();

                http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "Your API Token");

                http.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                var response = await http.GetAsync(uri.Uri).ConfigureAwait(false);

                if (response.IsSuccessStatusCode)

                {

                    var result = await response.Content.ReadAsStringAsync().ConfigureAwait(false);

                }

            }

        }

    }

}
import java.io.IOException;

import java.net.URI;

import java.net.URISyntaxException;

import org.apache.http.HttpEntity;

import org.apache.http.client.methods.CloseableHttpResponse;

import org.apache.http.client.methods.HttpGet;

import org.apache.http.client.utils.URIBuilder;

import org.apache.http.impl.client.CloseableHttpClient;

import org.apache.http.impl.client.HttpClients;

import org.apache.http.util.EntityUtils;

public class CareerOneStopAPISample {

    public static void main(String[] args) throws IOException, URISyntaxException {

    URI uri = new URIBuilder()

        .setScheme("https")

        .setHost("api.careeronestop.org")

        .setPath("/v1/stateresources/{userId}/{state}/{audience}/{startRecord}/{limitRecord}")

        .build();

    CloseableHttpResponse response = null;

    HttpGet httpGet = null;

    try {

        CloseableHttpClient httpClient = HttpClients.createDefault();

        httpGet = new HttpGet(uri);

        httpGet.setHeader("Content-Type","application/json");

        httpGet.setHeader("Authorization", "Bearer Your API Token");

        response = httpClient.execute(httpGet);

        HttpEntity entity = response.getEntity();

        System.out.println(EntityUtils.toString(entity));

    } finally {

        if(httpGet != null) httpGet.releaseConnection();

        if(response != null) response.close();

    }

   }

}

Request Parameters

Refer to the following table for a list of the required and optional request parameters. All parameter names and values are case sensitive. Important: You must provide all required parameters. Submitting an empty request does not return all possible results; an empty request returns an error.

Parameter Name Value Required? Description
API Token
String
Yes
This value is the unique API Token provided during the CareerOneStop Web API registration process
userId
String
Yes This value is the unique UserID provided during the CareerOneStop Web API registration process
state
String    
Yes This value accepts any U.S. state or territory (example:  IL)
audience
String
Yes Use any of these values: CareerOneStop (general audience), Ex-Offender, Unemployment, Veterans, Business, or Youth.
startRecord
String

This value is to set the starting record. Default value is 0, for the first record.
limitRecord
String

This value sets the maximum number of records to be returned. Default value is 10.

Response Structure

{

  "RecordCount": 1,

  "TitleRecordCount": 2,

  "LSPCount": 3,

  "StateResourceTitleList": [

    {

      "ResourceType": "string",

      "ResourceTitle": "string"

    }

  ],

  "StateResourceURLList": [

    {

      "WebsiteURL": "string",

      "WebsiteDesc": "string",

      "URLType": "string",

      "CustomURL": "string",

      "Address1": "string",

      "Address2": "string",

      "City": "string",

      "Phone": "string",

      "Zipcode": "string",

      "State": "string"

    }

  ]

}
<StateResources xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/XPAND.CareerOneStop.WebApi.ViewModels">

  <LSPCount>3</LSPCount>

  <RecordCount>1</RecordCount>

  <StateResourceTitleList>

    <StateResourceTitle>

      <ResourceTitle>string</ResourceTitle>

      <ResourceType>string</ResourceType>

    </StateResourceTitle>

  </StateResourceTitleList>

  <StateResourceURLList>

    <StateResourceURL>

      <Address1>string</Address1>

      <Address2>string</Address2>

      <City>string</City>

      <CustomURL>string</CustomURL>

      <Phone>string</Phone>

      <State>string</State>

      <URLType>string</URLType>

      <WebsiteDesc>string</WebsiteDesc>

      <WebsiteURL>string</WebsiteURL>

      <Zipcode>string</Zipcode>

    </StateResourceURL>

  </StateResourceURLList>

  <TitleRecordCount>2</TitleRecordCount>

</StateResources>

Response Parameters

Name Description Type Parent
RecordCount Record Count Number
TitleRecordCount Title Record Count Number
LSPCount The count of the state resources of type "Local Service Providers" Number
StateResourceTitleList State Resource Title List Array
    ResourceType  Resource Type string StateResourceTitleList
    ReourceTitle Resource Title string StateResourceTitleList
StateResourceURLList State Resource URL List Array
    WebsiteURL Website URL string StateResourceURLList
    WebsiteDesc Website description string StateResourceURLList
    URLType URL type, or category string StateResourceURLList
    CustomURL Name of the resource (apologies for the name of this parameter) string StateResourceURLList
    Address1 Address 1 string StateResourceURLList
    Address2 Address 2 string StateResourceURLList
    City City string StateResourceURLList
    Phone Phone string StateResourceURLList
    Zipcode ZIP code string StateResourceURLList
    State State string StateResourceURLList

Errors

Error/Status Code Description
 200
OK / Success. The request went through successfully and there is a response body.
 400
Bad Request (Request was invalid or missing parameters)
 401    
Unauthorized. This error occurs specifically when authentication is required and has failed or has not yet been provided correctly. (ex: Invalid API Token)
 404
This error will be shown in two scenarios 1) Not found - (An error occurred) and 2) Not found - (No data available)
 500
Internal Server Error. This error will occur when there is something critically wrong in the API call.