As a content owner I would like to retrieve reports by using the reports.query method in the YouTube Analytics API. When I execute the request the error is: badRequest with the message The query is not supported. Code 400.
I fill in the following fields:
ids: contentOwner==MyContentOwnerId
start-date:2017-08-01
end-date:2017-08-10
metrics:views
Why do I receive the 400 error? Thanks for your time!
Robert
I tried your query and I got the same bad request error, however when I filter it down to the video level it provides me with the information I needed.
ids: contentOwner==ContentOwnerId
start-date: 2017-08-01
end-date:2017-08-10
metrics:views
dimension:day
filter:video==videoId
Hope this helps!
Related
I created a wrapper for using the newsletter2go endpoint
https://api.newsletter2go.com/forms/submit/{{form_id}}
When I post the request to that ep w/ an form_id I get the following response:
http status: 400
code: 10020
error message: Bad Request (invalid code xxxx)
Im using the id from the n2go backend:
Can anyone tell me whats about the error code 10020? The api docs containing nothing about that.
This is probably because you used big letters in your form_id. I had the same problem. The support told me, that only small letters are allowed.
I found finally out what the form_id have to be. It's the value you see in the Opt-In Email for the n2g argument, for example:
https://subscribe.newsletter2go.com?n2g=dummy-code-here
Otherweise check the sourcecode of the Embedded Form, there is a script in it which contains the form id.
Maybe this helps someone one day.
I'm trying to test the pass_thread_control function on Facebook Messenger, to have my Dialogflow bot direct ongoing conversation to a human operator. So far I'm stuck at even trying to get a "success" code in Graph API Explorer. I have reviewed Facebook's documentation ( https://developers.facebook.com/docs/messenger-platform/reference/handover-protocol/pass-thread-control/ ), carefully looked through different threads here or elsewhere. I have:
Subscribed my Facebook Page to receive messaging_handovers.
Set the Dialogflow chatbot app as the Primary Receiver.
Set the Page Inbox as Secondary Receiver.
...And I keep on getting various errors. For example, I try this request in Graph API explorer:
POST to https://graph.facebook.com/v5.0/me/pass_thread_control
with params:
{
"recipient": {
"id": "myPageID"
},
"target_app_id": "263902037430900"
}
{
"error": {
"message": "Unsupported post request. Object with ID 'me' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",
"type": "GraphMethodException",
"code": 100,
"error_subcode": 33,
"fbtrace_id": "AipGijCLKQOwOl6L792ZEgG"
}
}
Maybe the issue is the recipient PSID? This is the only parameter I have no idea where to get. What is the page scoped app-id? How do I get it?
Or maybe I missed some permissions...?
Any help getting me unstuck much appreciated...
Okay, I actually managed to figure it out.
First and foremost - I discovered the Page I was trying to pass the thread control to wasn't linked to my Facebook Business account and the chatbot app was. I added the page in Facebook Business Manager so that it's linked to the same business account as the chatbot app. NOTE: I am not sure that this is a prereq for everyone, so take caution. It might not be required in all scenarios.
To retrieve the Page PSID, which can then be used in the 'recipient' param of the POST request to pass_thread_control, Sent a GET request using Graph API Explorer as shown here: https://developers.facebook.com/docs/facebook-login/connecting-accounts#examples
Even though the example request does not contain the appsecret_proof param, I used it and haven't tested the request without it. A very simple way of generating appsecret_proof using PHP is shown here: https://developers.facebook.com/docs/graph-api/securing-requests#generate-proof
Then when providing the PSID obtained using method shown in point 2., I got "success:true" while testing the pass_thread_control, which did pass the thread control to Secondary Receiver = Page Inbox. Yaaay! 😊
All of the above is described also in this thread, which helped me figure it out, so credit to Sunil: Is Facebook Messenger PSID PageScope constant for User
In my web browser developer tools, I am trying a fetch request.
and am receiving a 401 (Unauthorized) error.
I know I have the correct credentials because it works in postman. Can you help me understand what is wrong? Maybe is the syntax?
I assume the error is within
{Authorization:'Basic YWIamnottypingouttherestofmycreds'}
but I have tried every variation of this, ie:
{'Authorization':'Basic YWIamnottypingouttherestofmycreds'}
{Authorization:Basic YWIamnottypingouttherestofmycreds}
{'Authorization':Basic YWIamnottypingouttherestofmycreds}
fetch("http:/someoneelsesite.com",{mode:"no-cors",headers:{Authorization:'Basic YWIamnottypingouttherestofmycreds'}}).then (a => a.text()).then(console.log)
I'm having an issue setting up to the HERE API using Postman following these two guides: 1, 2.
Anyways, I've loaded the Postman collection, set the global environment and placed in my app-id and app-code (Freemium account) but I still get the following error when trying to get the access token:
{
"msg": "app_id or app_code is wrong",
"kind": "datalens#error",
"code": 402
}
Does anyone have any experience with getting through this? I've tried a million different little variations but I still get the same error. Any help is vastly appreciated. Thanks
Unfortunately the Geovisualization REST API is the only API on the portal that's currently not part of the Freemium plan. I apologize for the unclear error message and will look into improving this. To gain access please contact us through the portal.
Im using SendBird platform API to create chat in my website,
when i try to retrieve the previously send messages in a channel using below API:
https://api.sendbird.com/v3/{channel_type}/{channel_url}/messages
METHOD : GET
Request: ?message_ts=long(Required)&prev_limit=int(Optional, default: 15, 0~200)&next_limit=int(Optional, default: 15, 0~200)&include=boolean(Optional, default: true)&reverse=boolean(Optional, default: false)&custom_type=string(Optional)&message_type=string(Optional)&sender_id=string(Optional)
after passing value to above request,im getting an error saying
{
"message": "Not authorized. Get messages function can be called only from Park or Enterprise plan.",
"code": 400108,
"error": true
}
can some one please help me with this
Thanks
Nithin
The Message Retrieval API which you are calling is a premium feature as you can see in Senbird's Pricing Page.
You will have to contact Sendbird and upgrade to their premium plan in order to retrieve message and successfully call the endpoint.
You can retrieve messages in SDKs (available for JavaScript too).
In Android call this method,
mChannel.getPreviousMessagesByTimestamp()
where mChannel is an object of type GroupChannel(OpenChannel also allowed).
And as far as I know, it is ok to retrieve messages like that.
For Javascript
refer to this link