Till senaste kommentaren
Detta inlägg är gammalt och kan innehålla inaktuell information.

API stopped working for me even though api key is present and not marked as expired

Hi there,
I am using resrobot trips api and I have noticed that it stopped working for me, even though when I login, api key is shown under my project and is not market in any way as expired.

When I attempt to click on 'more information about api keys' I get 'not authorized to see this page'. I also noticed site was asking me to save personal information so I went ahead and added my name, second name etc and clicked save. It first shown me green snackbar saying 'all went well' but then when page was reloaded, it asked me for personal information again. I filled it in few times and it is still not shown under my details and the site still asks for my personal info.

I am sharing these in case if it is of some relevance.

Here is a request I am making:
https://api.resrobot.se/v2.1/trip?format=json&date='2022-12-07'&time='08:00'&originCoordLat=59.3774&originCoordLong=17.9664&destCoordLat=59.3774&destCoordLong=17.9664&lang='en'&accessId=

Here is response I am receiving:
{"serverVersion":"2.25.0","dialectVersion":"2.25","errorCode":"API_AUTH","errorText":"access denied for key  on tripSearch identified by tripSearch","requestId":"default-request-id"}

Please help.

Warm regards
Zoryana Tischenko
Zoryana Tischenko

Kommentarer

  • Also, can you please help me to get new api key - I am writing you first time and I did not realise I am writing to the forum where people can see my post.

    Old key isn't working anyway, so please, help.
    Zoryana Tischenko
  • Hi,

    I removed the API key from your request so it isn't public anymore, but I noticed that you include several quote characters ' in your request. The date, time, lang and accessId in your request are currently invalid, and should not contain ' .

    Regards,
    Bert
    Bert på Trafiklab
  • Thank you for your prompt response, Bert, and for removing the api key from the post - much appreciated!

    I think now, with your help, I am good. I am sharing below in case someone else will find it useful.

    I went ahead and removed single quotes from request url. Url now looked like this
    https://api.resrobot.se/v2.1/trip?format=json&date=2022-12-07&time=08:00&originCoordLat=59.3774&originCoordLong=17.9664&destCoordLat=59.3774&destCoordLong=17.9664&lang=en&accessId=<API_KEY>

    Response from server was still an error, albeit a different one, but not in slightest helpful:
    {"serverVersion":"2.25.0","dialectVersion":"2.25","errorCode":"INT_ERR","errorText":"internal error (FAIL).","requestId":"default-request-id"}

    I could see it was not an issue with api key as when I used the same api key with sample request from documentation, I got a proper response with lots of data in it.

    After checking each query param against documentation and verifying that all of them are supported, I went online and checked coordinates used in this request, thinking, maybe, I have used some weird, unsupported pair of coordinates.

    And then I realised that my origin and destination pair of coordinates were identical. These were populated programatically by the app I am working on, so, it is a bug I need to handle, since api.resrobot.se/v2.1/trip endpoint cannot handle paid of identical coordinates and responds with INT_ERR. Something I can totally live with 😃

    Once I updated request url with coordinates that were different, it worked fine.

    Thank you for your help, Bert.

    Warm regards
    Zoryana Tischenko


    Zoryana Tischenko
  • Hi Zoryana,

    Glad to hear its working now!

    Regards,
    Bert
    Bert på Trafiklab

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.