403 Forbidden resposnse from a GET request to http://api.espn.com/v1/sports/news/6277112 - espn

I have problem with the ESPN API:
I have an API key, and sent a query to the address http://api.espn.com/v1/sports/news/1581816?region=GB, which included my API key in the parameters.
I received 403 forbidden response: with this JSON
{
"status": "error",
"code": 403,
"message" : "Account Inactive"
}
I am looking at http://developer.espn.com/docs/headlines#using-the-api and at the last line it says that i can make a GET request to this url and it should work, but it doesn't.
How can I receive a valid response from the ESPN servers?

I just test it and it works fine. That means your key is invalid, or you are not including it. Replace below and it will work.
http://api.espn.com/v1/sports/news/1581816?region=GB&apikey=<yourKey>
--
{
timestamp: "2013-10-13T15:33:49Z",
resultsOffset: 0,
status: "success",
resultsLimit: 10,
resultsCount: 1,
headlines: [
{ ... }
]
}

Related

youtube.liveChatMessages.list API Explorer

I try list messages from LiveChat of YouTube. Request:
GET https://www.googleapis.com/youtube/v3/liveChat/messages?liveChatId=Qfad59EnhUA&part=snippet&key={YOUR_API_KEY}
Response:
404 Not Found
{
"error": {
"errors": [
{
"domain": "youtube.liveChat",
"reason": "liveChatNotFound",
"message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests <code>liveChatId</code> parameter to ensure that it is correct."
}
],
"code": 404,
"message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests <code>liveChatId</code> parameter to ensure that it is correct."
}
}
Pages https://www.youtube.com/live_chat?is_popout=1&v=Qfad59EnhUA and
https://www.youtube.com/watch?v=Qfad59EnhUA exist.
What's wrong?
i decide this problem. liveChatId can be get from broadcast for python:
print '%s' % (broadcast['snippet']['liveChatId'])

user.messages.get responding invalid ID

when attempting to test out the api explorer for user.messages: get I have been getting an invalid message ID response.
I am getting the message ID from a recent email in my inbox sent to me, and removed the <> from either ends.
response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid id value"
}
],
"code": 400,
"message": "Invalid id value"
}
}
I am a bit confused as I am using the powershell module gshell and noticed that the same messageID worked in my commands but returned invalid id value in the api explorer.
edit: if I do a inbox search for rfc822msgid:[messageID] it returns the correct message
First you have to call the users.messages.list api. It will give a list of messageids. Then we have to call users.message.get api with each messageid to fetch the mail content. You can query the mails with advanced search options provided by Gmail API.
You should not use the rfc822msgid, but the Gmail API message id. Try to list messages and use the id you get from that when getting the message.

Google API "games.players.get" returns 500

I'm trying to get player info for authenticated user, it successful for the first request, but then fails later.
{
"error": {
"code": 500,
"message": null
}
}
I already turning on OAuth 2.0, set the playerId to 'me', but it returns 500.
Is there something wrong? Is there any limit requests for this one? Is anything missing?
Thanks,

MailChimp API 3.0 batch request returns 400 Invalid Resource error

I've been trying to use the batch endpoint of MailChimp API (version 3.0) to subscribe new users to a list, but can't make it work.
Here is the request:
POST /3.0/batches
{
"operations": [
{
"method" : "POST",
"path" : "lists/c852ce5c86/members",
"body": "{\"email_address\":\"email#domain.tld\", \"status\":\"subscribed\"}"
}
]
}
The request seems ok cause I get a 200 response:
{
"id": "49abca6ef3",
"status": "finished",
"total_operations": 1,
"finished_operations": 1,
"errored_operations": 1,
"submitted_at": "2015-09-21T18:11:16+00:00",
"completed_at": "2015-09-21T18:11:23+00:00",
"response_body_url": "https://mailchimp-api-batch.s3.amazonaws.com/49abca6ef3-response.tar.gz?..."
}
However, as you can see, the only operation in my batch is errored.
Here is the response_body_url for this operation:
[{
"status_code":400,
"operation_id":null,
"response":"{
\"type\":\"http://kb.mailchimp.com/api/error-docs/400-invalid-resource\",
\"title\":\"Invalid Resource\",
\"status\":400,
\"detail\":\"The resource submitted could not be validated. For field-specific details, see the 'errors' array.\",
\"instance\":\"\",
\"errors\":[{
\"field\":\"\",
\"message\":\"Schema describes object, NULL found instead\"
}]
}"
}]
which is not very helpful :(
Note that if I directly hit POST lists/c852ce5c86/members with {"email_address":"email#domain.tld", "status":"subscribed"} payload, it's working properly.
That was actually a bug in the mailchimp API. After reaching them they quickly fixed it.

Rest API batch response status

Suppose there is POST /inteview/:id/invite route.
Parameters are email addresses:
{ 'emails': ['foo#test.com', 'bar#test.com'] }
Response should indicate that some addresses are successfully invited some not. For example:
[ {
"email": "foo#test.com",
"status": "already invited"
},
{
"email": "foo#test.com",
"status": "already invited"
}
]
Which status to return for partial success?
The Response's HTTP Status Code should be 200 OK, since you are getting the expected server's response.
Whether an email is invited or not, is not an actual error.

Resources