Trying to GET an image using its id with Facebook graph API - graph-api-explorer

I have been trying to issue an HTTP request to GET an image from Facebook Graph API, i entered the following command into the graph API Explorer:
https://graph.facebook.com/v2.5/{picture-id}/picture
I got the following results:
{
"data": {
"is_silhouette": true,
"url": "https://fbstatic-a.akamaihd.net/rsrc.php/v2/y6/r/_xS7LcbxKS4.gif"
}
}
I made sure from the image id, and i was able to get its url using inspect element.
Thanks for any help!!

Related

"Sorry we could not fetch the image" Pinterest error even though Image is publicly accessible

I am not sure what the real issue is but my image is publicly accessible via a url similar to
https://storage.googleapis.com/myapp.appspot.com/IMAGES/ead253addf86583ba57b7265ad9c999ba437b9ded695ac4b5bce6d78ccfe0c1b.png?GoogleAccessId=firebase-adminsdk-pgu3n%myapp.iam.gserviceaccount.com&Expires=253376550000&Signature=JgJcZK4vhn3uKThzcouTx7Pm92LrXhHEjxfPbvbiFzCXyUKH%2FuXhsH1M4Jn8KpUgi8HJcHqBMk2E7VEvHqEmmWLYmeGhBaDakZUSLQVUFEqbbxxU0e5RvsKOz66%2BymVywII9rL02xkjy10Is6ZibkfnSTG2xkNQ5XCdLoctSowZtu7dKf6OvZN48xI3cAPwcQbHLZ3n12I3%2BCsVnDiUcq4mybzKmA9e8dyKPvjYOskhmc0hO3bb%2BokxWF8wsyZ%2BGn7sjCgrvnyow%2FpxWm%2BlLVtEsbOFDZRUgmWOzgHNgcriX5MCLDNSmwRuRVl4xZtU0tcnX7dDp7XDiQqxU%2BBj6hQ%3D%3D
However whenever I submit the image url to pinterest api via the following request body:
requestBody['media_source'] = {
source_type: 'image_url',
url: mediaUrl
}
I keep getting back the following error message:
{
"code": 1,
"message": "Sorry we could not fetch the image."
}
But the url is very much accessible by anyone so why is pinterest unable to get this image.
It's really weird.
Please help.

How do you update your profile picture using Microsoft Graph API?

I'm experimenting on Microsoft Graph API to update the profile picture.
Although there is a documentation about it (See Link Here: https://learn.microsoft.com/en-us/graph/api/profilephoto-update?view=graph-rest-1.0&tabs=javascript), I can't seem to understand it.
I tried sending a random data to see if something would work, however I can only get the GET Method to work but somehow trying to make the PUT Method work returns an error.
{
"error": {
"code": "ErrorInsufficientPermissionsInAccessToken",
"message": "Exception of type 'Microsoft.Fast.Profile.Core.Exception.ProfileAccessDeniedException' was thrown.",
"innerError": {
"date": "2022-04-15T07:10:11",
"request-id": "********-****-****-****-************",
"client-request-id": "********-****-****-****-************"
}
}
}
Basically the two concerns are:
How to use the PUT Method for updating the profile picture using Microsoft Graph API
Why am I receiving the error as if I'm not allowed to update?
Is it because I'm doing the PUT Method incorrectly?
Is it because I need some sort of subscription to use the API?

POST request to Envelopes:create method

First of all - all code on PHP and JS.
I took all user data (sub, base_uri, account_id ) with that documentation https://developers.docusign.com/esign-rest-api/code-examples/config-and-auth at my site using cURL
Now I need send pdf file for that I generate at my site with that access for user sign like I have understood I need that https://developers.docusign.com/esign-rest-api/code-examples/signing-from-your-app and Envelopes: create https://developers.docusign.com/esign-rest-api/reference/Envelopes/Envelopes/create#examples
I send POST request to https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes with accountId=account_id from user data, also I send json with user data and doc data in base64 in, but there is nothing, so I don't understand:
How should I call "create" method with POST to https://demo.docusign.net/restapi/v2/accounts/{accountId}/envelopes ?
What Id should I use in {accountId}?
At what format should I send the document for the sign?
Where can I find that doc after create?
Can you show me code example or show documentation with normal examples of POST request for that method.
If you are using a demo environment, I believe your authentication url is https://demo.docusign.net/restapi/v2/login_information. For production accounts, since the subdomain can be different you can find the correct baseUrl using a GET request to https://www.docusign.net/restapi/v2/login_information?api_password=true using Postman. This gives you the right baseUrl as well as your authentication information.
Here is how you can create a template using a base64 which is a POST call to {{baseUrl}}/templates
{
"documents": [
{
"documentBase64": "<insert encoded base64 here",
"documentId": "1",
"name": "blank1.pdf"
}
],
"envelopeTemplateDefinition": {}
}
Also, if you need to generate more requests make sure you check out the Postman collection that contains different examples as Sebastian mentioned too:
DocuSign Postman Collection

Instagram API not returning followers

I'm authenticated with Instagram, and I got an access token with scope follower_list. Then I tried to get my followers list:
https://api.instagram.com/v1/users/self/followed-by?access_token=123.456
and all I got was an empty array, like following
{
"pagination": {},
"meta": {
"code": 200
},
"data": []
}
I don't really know if this is a problem from Instagram side or this is an expected behavior since I'm on Sandbox mode (although the documentation says I can expect to get real data even on Sandbox mode)
This is expected behavior.
In sandbox mode you will only get data from you and your sandbox users.
Add one of your followers to your sandbox, then only that user will be in API response. Once you go live, all users will be in API response.

Posting on facebook via unificationengine

Hi I'd like to post to facebook via unification engine. I've already created a user, added and tested successfully a facebook connection, but when I post I get the following response:
{"Status":{"facebook":{"status":190,"info":"Error validating access token: Session does not match current stored session. This may be because the user changed the password since the time the session was created or Facebook has changed the session for security reasons.: "}},"URIs":[]}
When I use the facebook token, that was used for creating the connection, to post to facebook directly (without unificationengine), then it works just fine. What might be the problem here? Status 190 is neither documented on facebook nor on unificationengine.
#unificatinengine developers: it would be practical, if the errors returned by the service would be passed on inside the unificationengine response, this way debugging such errors would be easier, and the errors could also be processed programmatically.
Additional info
Today I seem not to be able to reproduce the response of yesterday. The postfields I use to post the message to facebook (the same as yesterday) are as follows:
{
"message":{
"receivers":[
{
"name":"me",
"address":"https://graph.facebook.com/v2.1/me/feed",
"Connector":"facebook"
}
],
"sender":{
"address":"sender address"
},
"subject":"test",
"parts":[
{
"id":"0",
"contentType":"text/plain",
"type":"body",
"size":25,
"data":"this is the plain message"
},
{
"id":"1",
"contentType":"text/html",
"type":"body",
"size":42,
"data":"<div>this is the <b>html</b> message</div>"
},
{
"id":"2",
"contentType":"text/plain",
"type":"link",
"size":17,
"data":"http://www.web.de"
},
{
"id":"3",
"contentType":"text/plain",
"type":"link_description",
"size":21,
"data":"some link description"
},
{
"id":"4",
"contentType":"text/plain",
"type":"link_title",
"size":10,
"data":"link title"
}
]
}
}
But today I get the following message back from unificationengine
{
"Status":{
"facebook":{
"status":100,
"info":"Unsupported post request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api: "
}
},
"URIs":[]
}
Unfortunately this does not tell me, what unificationengine does internally for posting to facebook (which should not concern me), and what goes wrong there.
Does the "/v2/connection/info" show the details of the facebook connection that you have added? If not can you please update the connection with a new access token, using the same connection identifier for the "v2/connection/add" api endpoint, and check if it works.
unificationengine

Resources