Custom GPTs Actions External API Error

Can someone please help with a very basic external API call in the Custom GPTs? to the Bureau of Labor Statistics? Below is the JSON I have for my action. There is no authentication requirements.

I’m constantly getting a 404 error with blank results. However when I run this as a python script from my local machine it runs just fine and returns data.

Please help :frowning:

The JSON:

openapi: 3.0.0
info:
  title: BLS Economic Data Action
  version: "1.0"
servers:
  - url: 'https://api.bls.gov/publicAPI/v1'
paths:
  /timeseries/data:
    post:
      summary: Retrieve data for one or more time series within a set time frame
      operationId: getBlsData
      x-openai-isConsequential: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                seriesid:
                  type: array
                  items:
                    type: string
                  description: List of series IDs
                  example: ["CUUR0000SA0", "LNS14000000"]
                startyear:
                  type: string
                  description: Start year of the data range
                  example: "2020"
                endyear:
                  type: string
                  description: End year of the data range
                  example: "2023"
      responses:
        '200':
          description: Successful response with economic data
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                  results:
                    type: object
                    properties:
                      series:
                        type: array
                        items:
                          type: object
                          properties:
                            seriesID:
                              type: string
                            data:
                              type: array
                              items:
                                type: object
                                properties:
                                  year:
                                    type: string
                                  period:
                                    type: string
                                  periodName:
                                    type: string
                                  value:
                                    type: string
                                  footnotes:
                                    type: array
                                    items:
                                      type: object
                                      properties:
                                        code:
                                          type: string
                                        text:
                                          type: string
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string

You should be able to see the data the GPT is sending in the call, via the Preview window. What does that say?

1 Like

Thanks for the quick reply! Here’s what it’s sending:

[debug] Calling HTTP endpoint
{
“domain”: “api.bls.gov”,
“method”: “post”,
“path”: “/timeseries/data”,
“operation”: “getBlsData”,
“operation_hash”: “cc75c1b4476516cc600e28286b3e5018d3f3223b”,
“is_consequential”: false,
“params”: {
“seriesid”: [
“CUUR0000SA0”
],
“startyear”: “2021”,
“endyear”: “2023”
}
}
[debug] Response received
{
“response_data”: {
“status”: “REQUEST_FAILED”,
“responseTime”: 0,
“message”: [
“404 Error - Page Not Found”
],
“Results”:
},
“status_code”: 404,
“action_id”: “g-9e75339161376865ea6bf66cbf3b60b8bd0bc6c2”
}

Weird… I can access it via Postman, but only if I add a / at the end of the url. Try adding that to the schema? so path becomes /timeseries/data/

I’ve never seen that before, but… if I miss off the / then I get 404 not found.

1 Like

Wow thank you so much!

Adding the “/” after data literally did it!

So this is all I needed to fix in my JSON:

/timeseries/data/: