I'm passing the following to the youtube.channels.list method in the YouTube Data API (v3).
[key] => foo,
[forUsername] => royaloperahouse,
[part] => topicDetails
But my response just contains a 500 Internal Server Error:
{
"error": {
"code": 500,
"message": null
}
}
I get the same behaviour from the Google Developers Console. What could be causing this? Am I missing something here?
YouTube confirmed this was an API bug and it was subsequently fixed.
Related
We are getting 400 API error on some of the files when we try to download them using below API:
https://graph.microsoft.com/v1.0/users/<user-id>/drive/items/<item-id/content
API doc : https://learn.microsoft.com/en-us/graph/api/driveitem-get-content?view=graph-rest-1.0&tabs=http
Error:
"error": {
"code": "invalidRequest",
"message": "One of the provided arguments is not acceptable.",
"innerError": {
"code": "badArgument",
...
Same API calls works for most of the files, but we are getting this error recently.
Kindly let me know What's the reason behind it? and how can we fix?
We have encountered the following InternalServerError from the MS GraphAPI when invoking the /messages endpoint for several users and filter expressions.
For example, the following request consistently fails:
The request:
GET https://graph.microsoft.com/v1.0/users/{userPrincipalName}/messages?$top=100&$filter=isDraft eq false and createdDateTime ge 2017-06-09T05:11:58Z&$select=id,internetMessageId,from,sender,replyTo,subject,body,toRecipients,ccRecipients,bccRecipients,receivedDateTime,sentDateTime,createdDateTime,hasAttachments,parentFolderId,isDraft,isRead,changeKey,conversationId,parentFolderId
The response:
{
"error": {
"code": "InternalServerError",
"message": "Error while processing response.",
"innerError": {
"request-id": "b1ccb699-17da-4faf-9b8e-eba629be21e9",
"date": "2017-07-28T21:33:09"
}
}
}
It is important to note that if the timestamp in the filter expression is modified (e.g. by using a later timestamp) then the requests succeeds.
Changing the $top parameter from 100 to 10 also produces a valid 200 response.
Unfortunately, I cannot share the userPrincipalName in this post.
Is there a known issue with certain messages that may result in an internal error when retrieving messages? The request-id is in the response, so hopefully that could provide some clues.
Any help would be much appreciated!
I got the same problem in this error.
Try to downsize the header Prefer:odata.maxpagesize=200
or downsize the top query
It works for me.
I called the endpoint /shares/{shareId} using msgraph-sdk-php, but got response 400 as:
{
"#odata.context":"https://graph.microsoft.com/v1.0/$metadata#shares/$entity",
"id":"s!here-is-the-share-id",
"name#odata.type":"#String",
"name":{
"error": {
"code": "BadRequest",
"message": "A primitive value was specified; however, a value of the non-primitive type '' was expected.",
"innerError": {
"request-id": "3ea56b1c-acd6-4fdf-a856-c46b35e01cb7",
"date": "2017-05-25T05:26:23"
}
}
}
(Yes, I even got 4 left brackets but only 3 right brackets.)
while I can get correct response via api.onedrive.com api with the same shareId.
I really can't find any tips from documentation.
Thanks for letting us know about this #SevenOutman! This was a configuration issue that has now been resolved.
I'm trying to make this call to Youtube channels API but the response is without contentOwnerDetails. What is the problem?
GET https://www.googleapis.com/youtube/v3/channels?part=id%2CcontentDetails%2CcontentOwnerDetails&mine=true&key={YOUR_API_KEY}
It looks like it needs onBehalfOfContentOwner parameter. My request was
GET https://www.googleapis.com/youtube/v3/channels?part=snippet%2CcontentOwnerDetails&id=CHANNEL_ID&onBehalfOfContentOwner=NETWORK_ID
And I was able to get
"contentOwnerDetails": {
"contentOwner": NETWORK_ID,
"timeLinked": "2015-07-23T15:21:25.000Z"
}
For your GET method URI
https://www.googleapis.com/youtube/v3/channels?part=id%2CcontentDetails%2CcontentOwnerDetails&mine=true&key={YOUR_API_KEY}
The JSON response is as follows
{
"error": {
"errors": [
{
"domain": "youtube.parameter",
"reason": "authorizationRequired",
"message": "The request uses the <code>mine</code> parameter but is not properly authorized.",
"locationType": "parameter",
"location": "mine"
}
],
"code": 401,
"message": "The request uses the <code>mine</code> parameter but is not properly authorized."
}
}
According to YouTube Data API - Errors
401 (unauthorized) - authorizationRequired - The request uses the mine
parameter but is not properly authorized.
mine parameter value has to be set to true to instruct the API to only return channels owned by the authenticated user. (boolean)
Inference: You don't have the authorization to the content from the content owner, i.e., the YouTube Channel owner has probably denied permission to your application from accessing the channels content.
It's a permission issue. Where is the channelId in the URI? should probably add it.
If you don't own the channel the API will not return contentOwnerDetails. Since you're using mine=true parameter, you need to be properly authorized via OAuth first before the API will return contentOwnerDetails. See https://developers.google.com/youtube/v3/guides/authentication
I have managed to get a valid OAuth 2 token using the Google API for Youtube, but for some reason when making a request, either in my code (PHP) or in the test tools within the Youtube API (for example : https://developers.google.com/oauthplayground/) , I keep getting the following error :
[errors] => Array(
[0] => Array(
[domain] => youtube.header
[reason] => youtubeSignupRequired
[message] => Unauthorized
[locationType] => header
[location] => Authorization
)
)
[code] => 401
[message] => Unauthorized
OR
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}],
"code": 403,
"message": "Access Not Configured"
}
}
Can anyone please advise ?
Thank you in advance.
This probably means you have not yet enabled the YouTube Data API. 401 and 403 mean completely different things, however, so here's a checklist of things I would look for:
Verify that you have enabled the YouTube Data API in the Google API Console. It'll be under "Services". You'll need to flip them on. We did a short video tutorial about how to enable and retrieve developer keys.
If you're making an API call to upload videos or edit playlists, you'll need the account you're authorizing as to have a linked channel.
When these are done, you'll be able to download and run the PHP samples. We have a tutorial video for that as well.