Digital Assistant and Mobile

Get Involved. Join the Conversation.

Topic

    Asser
    How to access an API without credentials?
    Topic posted July 10, 2018 by Asser Green Ribbon: 100+ Points, last edited July 31, 2018 by Arijit ChakrabortyBronze Trophy: 5,000+ Points, tagged API, Bots, Facebook, OMCE, Tip 
    90 Views, 2 Comments
    Title:
    How to access an API without credentials?
    Content:

    On OMCe I have made a backend, added an API, and set the endpoints. I have set the "Login Required" switch to "off" (see image api_1.png). I assume that with this it should not ask for Authorization headers, but it returns a 401 unauthorized response (see image api_2.png).

    When I add Authorization header and Oracle-Mobile-Backend-ID to the GET request, it works fine (see image api_3.png).

    Is it possible to make a simple GET request to the API without having to provide the credentials? OR, can I add the access token and backend ID as a query param?

    Image:
    Document:
    api_2.PNG (38KB)
    Document:
    api_3.PNG (39KB)

    Comment

     

    • Grant Ronald

      You should be calling that API through a Mobile backend - for the mobile back end you can supply an authorization header as anonymous.

      regards

       

    • Martin Jarvis

      Hi Asser,

      All API calls have to be authenticated in some way. The login required switch means you would use one of the supported user authentications (BASIC, OAUTH). When it is switched off you need to use the anonymous access key that is configured against your mobile backend. You must expose your apis by adding them to a Backend. 

      Clear?

      Martin