Communications.makeWebRequest returns response code -403

Former Member
Former Member
Hi developers,

I am working on a widget that calls a server for some JSON data. I have the server running fine, and have confirmed that it delivers the expected JSON for that particular request. Also, the widget uses other server calls that all work fine and return OK. Now, for this particular request I get the response code "-403", but it is not documented in the API Docs (https://developer.garmin.com/downloa...nications.html), so I am kind of stuck on what this code means and how I could resolve the communications issue. Does anyone know what communications response code -403 means?

Edit: Widget is running in sim on my Windows pc, communicating with REST server on localhost.

Thanks!
  • What environment? (sim or device, windows or mac, Android or iOS, which target)

    Maybe post the makeWebRequest with the url, params, and options you use (obscure parts you don't want known like passwords, APIkeys, etc) in case it's something there.

    How large will the response be? Is it much larger than the others that work? Could the json data be a bit malformed?
  • Former Member
    Former Member over 7 years ago
    Thanks for your response. I added my environment specs to the original post (Widget is running in sim on my Windows pc, communicating with REST server on localhost). The code snippet is extremely trivial, there is no auth going on here. I am now looking into the response JSON syntax and size as per your suggestions.
  • Former Member
    Former Member over 7 years ago
    Resolution of my issue: it was indeed caused by the JSON response size, if I let the server return a smaller number of items, the request completes normally.

    However, I still find it strange that this results in response code -403, which is not documented in the API Docs. The appropiate response code should have been -402 in this case. It might be a simulator-specific issue, but I am not going to delve any further.

    Kudos to jim_m_58 for the quick reply and the push in the right direction.
  • It is documented if you look in the documentation provided with the SDK, perhaps the online link you used is out of date.
    NETWORK_RESPONSE_OUT_OF_MEMORY = -403

    I find documentation can be scattered so when i cannot find something i just do a text search of this PDF version.
    https://forums.garmin.com/forum/developers/connect-iq/158618-pdf-clone-of-connect-iq-sdk-documentation
  • Former Member
    Former Member over 7 years ago
    Thank you very much Mike for providing the info on that response code! Also, very interesting points you raise about documentation, I had no idea that the online version on the official Garmin Developer site is actually outdated. Those PDFs that you compiled are extremely useful!
  • As far as doc, I rely on what's in a given SDK, as the web version can at times be a version behind. In Eclipse, Connect IQ>Documentation takes you right there. And yes, -403 is documented in the 2.4.2 SDK version.
  • Thanks for pointing this out. We just need to update our online docs to reflect what we include with the build. Sorry about that. I've tagged this post with the ticket to address this. Will fix ASAP.

    Thanks,
    - Coleman
  • Former Member
    Former Member over 7 years ago
    I see that the online API docs have been updated, thanks Coleman.ConnectIQ!