Facebook Graph API v10 image upload to Pages feed - node.js

I'm trying to upload a image to facebook via graph api v10.
i have followed the docs: https://developers.facebook.com/docs/graph-api/resumable-upload-api/
I'm getting the File-Handle as result, but i dont know how to append this File-handle to my Page post. Does anyone know what i can do with this File-Handle to attach it to a Post I'm automatically posting after the file upload was successful?
Thanks!

I´ve got the same problem. In the Facebook Graph API Documentation it says:
When we're done with uploading the data, you'll get a file handle:
{"h":"2:c2FtcGxlLm1wNA==:image/jpeg:GKAj0gAUCZmJ1voFADip2iIAAAAAbugbAAAA:e:1472075513:ARZ_3ybzrQqEaluMUdI"}
This value can be used in place of an uploaded file for subsequent
graph calls.
However, no examples or further explanations are provided on how to use the received file handler.

Related

react-activity-feed: How to over ride the activity update on submit

I'm using the react-activities-feed components to manage the user side of feeds for our web app. The documentation is very lacking and I'm trying to figure out how to customize how the with a callback for making the post. I think it's the doRequest property, but I'm not 100% sure.
EDIT: It IS doRequest and it just expects a promise as a return. However... When I do my own doRequest and just console.log the input it's the activity. Which it great, BUT the images are already uploaded in this activity and have URL's
How do I hijack the image upload process and use my own? I use Google Cloud buckets with signedURL's.

Why call of Google Slides API returns error?

I have essentially been using this code to load an image into Google Drive and then transferring that image over to Google Slides using Python and for some reason it stopped working today.
The code I based mine off of is located here:
http://wescpy.blogspot.com/2016/11/using-google-slides-api-with-python.html
However, today I reran it and am getting an error:
googleapiclient.errors.HttpError: https://slides.googleapis.com/v1/presentations/PRESENTATION_ID returned "Invalid requests[0].createImage: Access to the provided image was forbidden.">
I am wondering if anything have changed in Google API?
Are you getting the same error today 2020/3/6?
<HttpError 400 when requesting https://slides.googleapis.com/v1/presentations/6-7HI:batchUpdate?fields=&alt=json returned "Invalid requests[24].createImage: Access to the provided image was forbidden.">
The error happens every time I am trying to push any image stored in Google Slides using either createImage or replaceAllShapesWithImage.
Note that the URLs pointing at Google Drive content are related to Public content. Thus, the workaround above mentioned by #miladio is not useful at this time.
I ran into the same issue. You should check out this link, which describes changes to the Drive API: Upcoming changes to the Google Drive API and Google Picker API
The proposed solution here seems feasible, although I have not fully tested it myself: Google script replaceAllShapesWithImage with image from drive doesn"t work any more

Python: adding comments to specific cell using Drive API

I am trying to automate some simple updating of a Google spreadsheet and I'm using the gspread library to do so. One task that is critical and not currently supported by gspread is the ability to add comments to a specific cell (there's an open issue for this and even a gist solution but I was getting a 404 error when trying to use it).
I know that the Google Drive API (v3) supports adding comments as described here, but I'm having issues with authenticating and could use some help.
What I have/know:
I have already setup the OAuth 2.0 and registered for the API through Google, as well as have the client_secret.json in my directory, but my knowledge of web requests and responses is limited so going through the Drive API documentation hardly makes sense. I know in order to create the comments I will have to make use of anchors and specify the cell location using column/row numbers.
What I'm stuck on:
When using the Google API Explorer, I'm getting a 400 error with the message: The 'fields' parameter is required for this method. How can I make the POST request using my authentication? I think from there I'd be able to actually add the comments myself.
I'm getting a 400 error with the message: The 'fields' parameter is required for this method
The error is asking for a property which you want returned (these properties are listed in Drive API files resource).
You can just place ' * ' to indicate you want it to return a complete response. That's the quick fix.

How can I get individual image_urls from an Instagram album using oembed api call?

I have been using the Instagram API to get images and videos, which works just fine. I then noticed the oembed API call, which does not require an access_token, and I decided to give that a try, which also worked just great as the thumbnail_url size is adequate for most uses.
However, I noticed that the images retrieved from an album, all have a thumbnail_url that returns a 5xx Error from Instagram.
My thinking is that:
a) This is exactly how it is supposed to work and if I want images from a gallery/album, I need to use the media API call and access_token like most normal people
b) There is a way to access all images from a gallery/album and I just don't know yet. What if I want to embed the album? If this is the case, how can I check if it is an album or single image before making an API call?
Here is what I have so far:
Instagram permalink for album/gallery: https://www.instagram.com/p/BTHpAmzDHKR/
OEMBED API call: https://api.instagram.com/oembed/?url=https%3A%2F%2Fwww.instagram.com%2Fp%2FBTHpAmzDHKR%2F
thumbnail_url returned: https://scontent-dft4-2.cdninstagram.com/t51.2885-15/s612x612/e35/18012162_1608580785827161_2716056344971968512_n.jpg
media API working url for same image:
https://scontent.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/18012162_1608580785827161_2716056344971968512_n.jpg
This opens up to a 5xx Server Error
Is it possible or not using oembed call?
NOTE: I am trying this just out of curiosity and not for any real app.
Closing this out as my research has shown that oembed is for single media type only, not for carousel/albums. Instagram API call which uses tokens is required.

Flickr API batch download

I was wondering if it's possible to use the Flickr API to get a batch of images (by doing a REST call and defining multiple tags), and providing a download button for the end user which allows him to download a zip file of the photos? I can get a list of all the image urls in JSON format, but not a whole batch.
I can't seem to find it in the Flickr documentation but was hoping someone could give me confirmation.
Thanks!

Resources