How to use Google Drive URL for Facebook Graph API - api

I try using Facebook Graph API with the upload photo feature.
I'm hosting the photo from Google Drive and the URL has the format: https://drive.google.com/uc?id=IMAGE_ID
But I received the error after I make the first request:
{
"error": {
"message": "Missing or invalid image file",
"type": "OAuthException",
"code": 324,
"error_subcode": 2069019,
"is_transient": true,
"error_user_title": "Image Required",
"error_user_msg": "Make sure your Page post includes an image that can be used in an ad.",
"fbtrace_id": "AMlEwvLBvptiO2kZc1DRnRN"
}
}
Does anyone have a solution to this problem?
I really appreciate your the answers.

Related

Error when uploading a video using instagram graph API

I want to upload a video using the instagram graph api however the API asks for an url (and not a local path) for the video parameter. The video I want to upload is on my desktop (local) so I don't know how I can convert it so it works.
When I put a local path instead of the url I get the following message:
`
{
"error": {
"message": "The video file you selected is in a format that we don't support.",
"type": "OAuthException",
"code": 352,
"error_subcode": 2207026,
"is_transient": false,
"error_user_title": "Unsupported format",
"error_user_msg": "The video format is not supported. Please check the specs for the supported streams format",
"fbtrace_id": "AA3qcWZCmMsp0OfEE_m1cLJ"
}
}
`

Google Sheets API Error code 400 API key not valid. Please pass a valid API key

I created a google cloud project and enabled the Google Sheets API. I created and API key that is restricted to Google Sheets API.
I am trying to access my sheet from this link: https://sheets.googleapis.com/v4/spreadsheets/${sheetId}/values/${sheetNameStr}?dateTimeRenderOption=FORMATTED_STRING&majorDimension=ROWS&valueRenderOption=FORMATTED_VALUE&key=${apiKey};
I am getting this error:
{
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "API_KEY_INVALID",
"domain": "googleapis.com",
"metadata": {
"service": "sheets.googleapis.com"
}
}
]
}
}
I have published the entire sheets doc as well as the specific sheet I want to access. The sheet is set up to be viewed by anyone who has the link.
I have tried other forms of the link, and it always comes back to this error. Any suggestions of where to go next is appreciated :)

Microsoft Graph API Invalid URI: The hostname could not be parsed. when using /search/query

I'm trying to search calendars by name with the v1.0/search/query endpoint from the Graph API. However even I'm trying the examples from the Explorer I get the following error:
{
"error": {
"code": "InternalServerError",
"message": "Invalid URI: The hostname could not be parsed.",
"innerError": {
"date": "2022-03-28T19:50:56",
"request-id": "ddb02afc-1c82-4884-d352-4a8d80809b20",
"client-request-id": "58147981-de34-ba11-ab1f-6e17dca603f9"
}
}
}
Graph Explorer:
Is this endpoint still supported? Is it not allowed for Applications?
From the output we can see that , in the tip its saying for adding the permissions for accessing Calendar events and its API's.
so please try to add those permissions and retry again. Please refer this DOC

How do I correct a URL Inspection API error?

I am trying to have the URL inspection API for my site, but I keep getting this error:
{
"error": {
"code": 403,
"message": "You do not own this site, or the inspected URL is not part of this property.",
"status": "PERMISSION_DENIED"
}
}
Trying to find out how to get this corrected.
First of all your email should have permission for accessing the siteUrl value that you have given in the inspection API. You can check your permission in the Google Search Console by login with your email. Secondly, In the siteUrl you need to give the exact website URL that you are registered in the Google Search Console. In my case, I got the same error because I have given
{
"inspectionUrl": "https://test.com/my-test-inspection-url",
"siteUrl": "https://test.com",
"languageCode": "en-US"
}
Instead of
{
"inspectionUrl": "https://test.com/my-test-inspection-url",
"siteUrl": "https://test.com/",
"languageCode": "en-US"
}
I have registered my website name as https://test.com/ in Google Search Console and I have given the siteUrl value as https://test.com

Youtube Analytics API - HTTP request for Associated Channel's data

I am new to YouTube Analytics API.
Could you please help me to retrieve data from my associated YouTube channel.
I have populated the data using “youtubeAnalytics.reports.query” in the APIs Explorer window.
But when I am trying to use the below HTTP request
https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3D{MY_ASSOCIATED_CHANNEL_ID}&start-date=2016-08-01&end-date=2016-08-31&metrics=views&dimensions=video&filters=video%3D%3D{MY_VIDEO_ID}&max-results=10&sort=-views&key={MY_API_KEY}
It shows an error message “Login Required”
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
Could you please help me to correct my HTTP request to populate the data.
Thanks,
Aneesh
As far as I know most all of the YouTube Analytics API is private data. Being that its private data you need to be authenticated in order to access it.
Your error "Login Required" means exactly that you need to be authenticated to access the data you are requesting. Probably using the scope
https://www.googleapis.com/auth/yt-analytics.readonly
Once you have authenticated your application you can do access_token={Access token gotten from authentication} in order to access that data.