Banner: Web API: Get UI web sites by state

Web API: Get UI web sites by state

Get UI web sites by state

The 'Get UI websites by State' API enables developers to retrieve State Unemployment Web Sites for unemployment information by providing location information.

About this data

Many states require people to file for unemployment benefits on the web. This Web API provides state Unemployment Insurance Sites. You can see the help page for more information on unemployment.

Resource URL

https://api.careeronestop.org/v1/unemployment/{userId}/{state}

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/unemployment/{userId}/{state}"

            };

           

            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/unemployment/{userId}/{state}")

        .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 is used to specify the state that is used to search for unemployment information

Response Structure

{

  "WebSitesList": [

    {

      "WebsiteId": "108",

      "URLType": "UI Additional Info",

      "CustomURL": "Unemployment Express Offices:

\r\n \r\nwww.vec.virginia.gov/vecportal/field/field_offices.cfm?textofficelist=true&pto= 

\r\n\r\n\r\n\r\n",

      "StateName": "Virginia"

    },

    {

      "WebsiteId": "436",

      "URLType": "UI URL",

      "CustomURL": "http://www.vec.virginia.gov/unemployed/online-services/apply-for-unemployment-benefits",

      "StateName": "Virginia"

    },

    {

      "WebsiteId": "486",

      "URLType": "UI TEL",

      "CustomURL": "1-866-832-2363",

      "StateName": "Virginia"

    },

    {

      "WebsiteId": "1246",

      "URLType": "UI GENERAL URL",

      "CustomURL": "http://www.vec.virginia.gov/unemployed",

      "StateName": "Virginia"

    }

  ]

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

  <WebSitesList>

    <UnEmploymentInsuranceDetail>

      <CustomURL>Unemployment Express Offices: &lt;br&gt;&lt;span style=`font-weight:normal`&gt; &lt;a href=# onclick=javascript:window.open(&amp;quot;http://www.vec.virginia.gov/vecportal/field/field_offices.cfm?textofficelist=true&amp;pto=&amp;quot;)&gt; www.vec.virginia.gov/vecportal/field/field_offices.cfm?textofficelist=true&amp;pto= &lt;/a&gt;&lt;/span&gt; &lt;br&gt; </CustomURL>

      <StateName>Virginia</StateName>

      <URLType>UI Additional Info</URLType>

      <WebsiteId>108</WebsiteId>

    </UnEmploymentInsuranceDetail>

    <UnEmploymentInsuranceDetail>

      <CustomURL>http://www.vec.virginia.gov/unemployed/online-services/apply-for-unemployment-benefits</CustomURL>

      <StateName>Virginia</StateName>

      <URLType>UI URL</URLType>

      <WebsiteId>436</WebsiteId>

    </UnEmploymentInsuranceDetail>

    <UnEmploymentInsuranceDetail>

      <CustomURL>1-866-832-2363</CustomURL>

      <StateName>Virginia</StateName>

      <URLType>UI TEL</URLType>

      <WebsiteId>486</WebsiteId>

    </UnEmploymentInsuranceDetail>

    <UnEmploymentInsuranceDetail>

      <CustomURL>http://www.vec.virginia.gov/unemployed</CustomURL>

      <StateName>Virginia</StateName>

      <URLType>UI GENERAL URL</URLType>

      <WebsiteId>1246</WebsiteId>

    </UnEmploymentInsuranceDetail>

  </WebSitesList>

</UnEmploymentInsurance>

Response Parameters

Name Description Type
WebSitesList
Web Sites List
Object
   WebSiteId
Web Site ID
String
   UrlType
URL Type
String
   CustomUrl
Custom URL String
   StateName
State Name String

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.