API Key - How to pass into Browser address bar?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vikscripts
    Junior Member
    • Nov 2021
    • 4

    API Key - How to pass into Browser address bar?

    Hi,

    I am in the process of developing an Android Mobile phone application and would like to test the URL which I imbed in the app,

    I have read the Developer documentation, including https://docs.espocrm.com/development/api-client-java/ however methods to query directly via the browser is not covered, also need to extroplate how to transpose and use the provided Java example into the "Android Studio IDE" and coding methods, which perfer the Kotlin language.

    I have an internal development Apache WEB server running on Ubuntu Linux headless server. I have set up a self signed SSL Cert.

    I have tried to use the following in the Google Chrome address bar on a second pc to test the access and response from my ESPOcrm on my internal server,

    "https://192.168.0.xxx/espocrm/api/v1/account?X-Api-Key=MyApiKeyHere "
    (I have tried many variants of this eg: api_key=xxx etc)

    The browser still requests a Username and password before alllowing a respose with the json data from the database.

    I have set up an API User and Api Role in ESPOcrm, I presume that should mean I should not be prompted for login credentials when using the API Key?

    Is my syntax incorrect or does the Esocrm API not allow passing of the API key via the browser address bar?



    regards,
    Vik
    Last edited by Vikscripts; 11-15-2021, 09:30 AM. Reason: More detail
  • yuri
    Member
    • Mar 2014
    • 8442

    #2
    Hi Vik,

    X-Api-Key should be passed in headers.
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Vikscripts
      Junior Member
      • Nov 2021
      • 4

      #3
      Hi Yuri,

      Thank you for the reply,
      Is there any way to pass the API Key via a browser address bar ?

      Comment


      • esforim
        esforim commented
        Editing a comment
        Not by default, you would need to write a new code for that... as for how difficult it will be is another question.
        Last edited by esforim; 11-16-2021, 11:28 PM.
    • Vikscripts
      Junior Member
      • Nov 2021
      • 4

      #4
      Hi espcrm,
      Thanks for the input,
      there seems to be some text missing from your comment - can I ask , write a new what ?

      Comment


      • esforim
        esforim commented
        Editing a comment
        Hi Vik, "new code" would be what I wanted to write. I edit the post now.
        Last edited by esforim; 11-19-2021, 05:28 AM.
    • Vikscripts
      Junior Member
      • Nov 2021
      • 4

      #5
      OK, Thank You

      Comment

      Working...