How can we improve Bibles.org?

Java

How do i access your api using postman or from my java based application; would you share any example i can use to access the api from my web based application. I tried few times and always opens an authentication page and though i enter my username and password it fails.

7 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    FrancisFrancis shared this idea  ·   ·  Admin →

    2 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Lucas HarskampLucas Harskamp commented  · 

        I FOUND IT I FINALLY FOUND IT! It's C# HttpWebRequest, but conversion to Java should be easy.

        At startup:

        ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) => { return true; };

        at request:

        HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://bibles.org/v2/versions/eng-GNTD.xml");
        request.UseDefaultCredentials = false;
        request.Credentials = new NetworkCredential("{TOKEN}","X");
        request.Method = WebRequestMethods.Http.Get;
        request.AllowAutoRedirect = true;
        HttpWebResponse response = (HttpWebResponse)request.GetResponse();
        using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
        {
        Debug.Log(string.Format("Code: {0}\nDesc: {1}\nType: {2}\nLength: {3}\nEncoding: {4}\nContent: {5}", response.StatusCode, response.StatusDescription, response.ContentType, response.ContentLength, response.ContentEncoding, streamReader.ReadToEnd()));
        }

      • David LeachDavid Leach commented  · 

        Hi Francis. I'm not a Java developer, but hopefully I can help you get started using the API. First, if you haven't checked out the API documentation you can find it here: http://bibles.org/pages/api/documentation

        You'll need to create an application within your bibles.org account in order to get an API key. You can do that here: http://bibles.org/account/apps/edit

        Once you've created the application you'll see the API key. That's what you'll use instead of a username/password to make API requests.

        Now, open postman and you'll want to make a GET request. Using the example from the API documentation, let's set the URL to https://bibles.org/v2/versions/eng-GNTD.xml

        In the Authorization tab of Postman (just under the URL) choose type "Basic Auth" and paste your API Key in for the username. Leave the password blank (actually you can put anything you want, the API ignores it). Click 'Update Request' to add the Authorization header to the request.

        When you click 'Send' you should see the response.

        Hope that helps!

      Feedback and Knowledge Base