R
R
Roman Kalita2016-07-27 11:18:42
JavaScript
Roman Kalita, 2016-07-27 11:18:42

How to properly use the github.com API?

How to properly use the github.com API?
I'm trying to get information on the token using a request to the API described at the link
https://developer.github.com/v3/oauth_authorizatio...
I'm making such a request in the address bar of the browser

https://api.github.com/applications/{Client ID}/tokens/{access_token}

But I get an answer
{
  "message": "Not Found",
  "documentation_url": "https://developer.github.com/v3"
}

What's wrong? Everything is as described in their documentation.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Kalita, 2016-07-28
@Engeneer

This is how the query worked

let userpass = btoa(`${clientId}:${clientSecret}`);

let url_2 = `https://api.github.com/applications/${clientId}/tokens/${x.access_token}`;
fetch(url_2, { 
            method: 'GET',
            headers: {
                'Authorization': `Basic ${userpass}`
            }
        } )
.then(x => x.json())
.then(x => {console.log(x)});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question