What is Error 4003 & Error 4002?

I often get the 4003 & 4002 Error when I request For directions from the ORS API. I don’t find a page where I can get the meaning. So can you tell What does these error codes mean?

Hi @LetsCode,

I am pretty sure that there is page with the error codes written down, but I can’t remember where it is - maybe @amandus knows…

In general though you should not get error codes starting with 4 from the directions end point as those error codes are for the POI service. If you mean 2003 and 2004, then those signify that there is an incorrect parameter value in the request (e.g. you have used too few coordinates or told it to avoid a feature type that is not supported), and 2004 means that the request exceeds some limit relating to the route (e.g. route is too long for the specified profile/restrictions combination).

1 Like
1 Like

Hi @adam,

Thanks For Your Reply.

However, What do you mean by POI service?

Hi @LetsCode,

he refers to this endpoint https://openrouteservice.org/dev/#/api-docs/pois/post

EDIT:
The First number basically indicates the endpoint that was used. If you e.g. get a 4003 for a routing request, that would be really strange as 4… are error codes for the /pois endpoint.

best regards

1 Like

I use Directions API But most of the time it ends up with 4003 or 4002 response code.

Could you please provide a request (without your api_key) and the error response in json format?

1 Like

I code in AI2 MIT app inventor and its distributions. Some days before I coded an extension with which you can get directions from open route service directly from your app. So it is little restricted with its raw response until the response code is 200, So I never get raw error response.

However the request generated by the extension is in this format

https://api.openrouteservice.org/v2/directions/driving-car?api_key=user_api_key&start=longitude,latitude&end=longitude,latitude

However its open source you can check it out here:

@LetsCode,

Sorry, but i can’t reproduce this.
For me a request like

https://api.openrouteservice.org/v2/directions/driving-car?api_key=xxx&start=8.681495&end=8.687872,49.420318

properly returns

{
  "error": {
    "code": 2002,
    "message": "Parameter 'start' has incorrect value or format."
  },
  "info": {
    "engine": {
      "version": "6.2.0",
      "build_date": "2020-07-20T07:00:32Z"
    },
    "timestamp": 1597666709279
  }
}

We generally don’t check external code. You can try to debug your extension.

If you can’t provide an actual request + response of your problem we are not really able to help.

Best regards

1 Like

I will try to get the Request And the Response in JSON format. And also try to debug my extension. :slightly_smiling_face:

1 Like