-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add Photos.downloadImage
method to download image of photo
#11
Comments
Currently working on registering the download since the current method doesn't work |
@edgarjc Could you share a bit more about what does not work? Do you get an error? |
The download method isn't actually "downloading" the image from unsplash. It seems like the get request isn't being sent correctly. After some digging, it looks like it takes in an id which according to their API isn't necessarily correct since each image has its own unique download token under download_location. I passed that dowload_location into the function It's still not tracking downloads. |
Hm. The If you are not immediately seeing the download counter of a photo increment, it could be that unsplash does some caching, and it takes a bit of time to reflect the download. |
So after a lot of troubleshooting, I think that the Request isn't correctly sending the Unsplash client credentials but I might be wrong about that. In the meantime the code below is what correctly implements the GET request in my project and it shows the download on the Unsplash dashboard.
|
Thanks for the update! I've looked at the official unsplash client for JS and there the client id is sent in the |
This method should download the image of the photo as well as hit the Unsplash API endpoint to register the download.
The text was updated successfully, but these errors were encountered: