Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authorization option documentation inferior, not existing #3

Open
mblpz opened this issue Oct 12, 2018 · 1 comment
Open

authorization option documentation inferior, not existing #3

mblpz opened this issue Oct 12, 2018 · 1 comment

Comments

@mblpz
Copy link

mblpz commented Oct 12, 2018

Hi there,

as i want to create screen shots from my website as a logged in user, i think i need to go for the authorization option in my urlbox.io api query.
Unfortunately my approach didn't work and the missing documentation or at least example urls left me stranded.
Could you please add either extended docs on this topic or examples?
Or hand me some so i can create a PR in the READMEs.

@cjroebuck
Copy link
Collaborator

cjroebuck commented Oct 12, 2018

Hi Mat, it really depends on how your site authenticates/authorises users. All that the authorization option is doing is sending an Authorization header along with the request set to whatever you pass in to it. If your site doesn't use the Authorization header as an auth mechanism, then it will have no affect. Some sites for example pass the authentication token in cookies. Do you use a well known library or framework for authing users?

As an example, if using basic http authentication the value of this header might be: "Basic " or if using token authentication such as OAuth it would be "Bearer ". The way you get is again dependent on your site, but usually there would be an API route such as POST /your/api/token which takes in a username/password and returns you an auth token.

Adding this option to your Urlbox screenshot request is just like any other option, you just need to remember to url-encode it once it's in the querystring: api.urlbox.io/v1/api_key/png?url=yoursite.com&authorization=Bearer%20yourtoken

Let me know if this helps, if you need further help feel free to email support at urlbox.io perhaps with some example URL and dummy account login which we can get working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants