Instagram Graph API to publish content - instagram

I have used the Instagram Graph API to publish posts on Instagram based on it's docs. I use this API as below to upload an image:
https://graph.facebook.com/17841401176636063/media?image_url=https://upload.wikimedia.org/wikipedia/commons/9/9a/Gull_portrait_ca_usa.jpg&caption=%23BronzFonz&access_token=IGQVJXMG9GZAlgtN0ZAGQzYxcm5GQzRUTl9pbENRSWU1NjVGeE81clJ4RHVJMlU4aVk3cnhibDdKaVVidUxpcmFnWl9qaDU3alFFeWtVS01MNE9uRnBqLXVjLVF1S0tqa3lRaHJyYDRn
And I get this result:
{
"error": {
"message": "Invalid OAuth access token.",
"type": "OAuthException",
"code": 190,
"fbtrace_id": "Ac6EIeqwzInWWyWs7H0jKhc"
}
}
What is wrong with my request?I am sure about the access token, I get it from https://graph.instagram.com/access_token and it is my long-lived access token.

Related

The caller does not have permission. Google Adsense Management Api

{ "error": { "code": 403, "message": "The caller does not have permission", "errors": [ { "message": "The caller does not have permission", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } }
It says you don't have permission. But I am logging in oauth2 with the adsense account itself. So it's not from a different account. It seems silly to me that there is an access permission issue here. I couldn't get past this error for about 1 day.
By the way, I get the same result in google's 'try this method' service.
SOLVED
I was entering the adsense email as the accounts parameter, the problem was here. API worked when using account name

Getting error while creating online meeting using graph api

Here i am using Microsoft graph api for creating online meeting events but after generating toke when i am requesting to create an online meeting i am getting this error
{
"error": {
"code": "ResourceNotFound",
"message": "User not found",
"innerError": {
"date": "2021-09-01T17:54:57",
"request-id": "fa773652-e824-4c9e-af05-085e249fb489",
"client-request-id": "fa773652-e824-4c9e-af05-085e249fb489"
}
}
}
enter image description here
Based on the So thread reference,
Use Delegated permissions to create an onlineMeeting
You must log in as a user, and you cannot use the client credential flow. You need to use the auth code flow to obtain the token.
Ref link - Delegated Permission: https://learn.microsoft.com/en-us/graph/api/application-post-onlinemeetings?view=graph-rest-1.0&tabs=csharp
SO Reference: 404 error while creating Online Meeting using microsoft graph api c# without login into AzureActiveDirectory

How to fetch media from the Instagram API

I'm trying to fetch media from an instagram account that I manage to display it on a website that I'm building:
Basically I want to run this query:
https://graph.instagram.com/{userId}/media?fields=id,caption,media_url&access_token=IGQ...
But as a response I get this error:
{
"error": {
"message": "Unsupported get request. Object with ID '31044158025' does not exist, cannot be loaded due to missing permissions, or does not support this operation",
"type": "IGApiException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "AOdEf2mCpah6zWwkEdiZU95"
}
}
I followed this guide from the official documentation to create the app on facebook developer account, get the access token etc.
I got the {userId} going on instagram and exploring the network requests from the developer tools (is there an easier way? :D)
Any help appreciated,
Thanks!
Matteo

Regarding azure login to different resources

Currently i'm authenticating to a resource one which is my backend. But using the same access token i tried to get data from Microsoft graph api it's giving
{
"odata.error": {
"code": "Authentication_MissingOrMalformed",
"message": {
"lang": "en",
"value": "Access Token missing or malformed."
},
"date": "2018-02-22T10:37:53",
"requestId": "381cf386-6065-422b-b561-164ed17dcfdf",
"values": null
}
}
How to resolve this. Is it possible to access both with one access token
No. An access token is always meant for one API/resource.
You must get two access tokens. You can use the refresh token or authorization code to get two.

Microsoft Graph InTune Beta API's - Unable to add app to app policy

I am attempting to use Intune specific beta Graph APIs to assign apps to an iOS managed app protection policy. I am able to create the app policies using the endpoint documented below:
https://graph.microsoft.io/en-us/docs/api-reference/beta/api/intune_mam_iosmanagedappprotection_create
When created via API, the app "deployedCount" is 0 until specific apps are added in the admin console UI.
Now, I am attempting to retrieve apps added to any policy by API using the endpoint documented below.
https://graph.microsoft.io/en-us/docs/api-reference/beta/api/intune_mam_mobileappidentifierdeployment_list
I get a 400 bad request response that appears to say this endpoint either does not exist or is not responding correctly. This seems unlike if I mistyped an endpoint.
Response I receive:
{
"error": {
"code": "No method match route template",
"message": "No OData route exists that match template ~/entityset/key/navigation with http verb GET for request /MAMAdmin/MAMAdminFEService/managedAppPolicies('T_338de6df-386d-4f1b-a51c-a0d189c61722')/mobileAppIdentifierDeployments.",
"innerError": {
"request-id": "79514f29-4dca-48a5-a2de-5d14138577d7",
"date": "2017-02-08T17:46:52"
}
}
}
Response if I mistyped:
{
"error": {
"code": "BadRequest",
"message": "Resource not found for the segment 'asdfasdf'.",
"innerError": {
"request-id": "e86d84ab-f062-4780-af3c-9afae6e7bc82",
"date": "2017-02-08T18:53:29"
}
}
}
Hello this is Alemeshet Alemu from MSFT.
Sorry, the API documentation is a bit out sync. Could you try with $expand?
GET /managedAppPolicies/{managedAppPoliciesId}?$expand=mobileAppIdentifierDeployments
Alemeshet Alemu (MSFT)

Resources