Invalid MailChimp API Key in Mailchimp Export API - api

I have everything ok in the Mailchimp account but still facing the following problem -
Type the URL - http://us1.api.mailchimp.com/export/1.0/list/?apikey=mykey-us6&id=myid
Output -
{"error":"Invalid MailChimp API Key: mykey","code":104}

This error occurs if you don't use the correct URL.
If your API key ends with "us9" the URL to be called is "http://us9.api.mailchimp.com/export/1.0/list/?apikey=yourkey-us6&id=yourid"
If the URL you have added in the question to work, you should add an API key ending "us1"

Related

Where to use the API authorisation key in this API?

I am working with the following api:
https://www.football-data.org/documentation/api
I have gotten myself an api key and I tried to make the example request:
https://api.football-data.org/v2/teams/86/matches?status=SCHEDULED
of course I get the error
{"message":"The resource you are looking for is restricted. Please pass a valid API token and check your subscription for permission.","errorCode":403}
So the question is, is how do I give the website my api key to allow me to make these requests?
Looking at the python snippet they create a dictionary with the the api key as a value and pass that to the request. How can I make this in my browser?
I tried
https://api.football-data.org/v2/teams/86/matches?status=SCHEDULED&%22X-Auth-Token%22=%22MYAPIKEY%22
and it did not work.
You are passing your API key as a query parameter, which is not in line with the API specification.
The API needs the key as an HTTP header. You cannot easily do that in a web browser. I'd suggest getting something like Postman or to do it on the command-line:
curl -i -H "X-Auth-Token: MYAPIKEY" "https://api.football-data.org/v2/teams/86/matches?status=SCHEDULED"
You might have figured it out by now, but I am dropping this for anyone else looking on how to do it in Python:
import requests
from pprint import pprint
token = "" # Write the api key emailed to you here
headers = {
'X-Auth-Token': token,
}
r = requests.get('http://api.football-data.org/v2/competitions/EC/teams', headers=headers).json()
pprint(r, indent=2, depth=1, compact=True)
If you're using postman like #Jakob Löhnertz suggested.
You want to first enter the api
Then go over to the Headers tab, put in "X-Auth-Token" as your Key and your unique API token as your value. Hit send and you should be all good.
Finally, be sure to go through here to see the list of available competitions for a free account.

Adding API Key from Big Commerce Store

I am trying to add an api key from my bigcommerce store to my developer account. I go in and add a user that has access to api, and this generates a key, and I click save. I then registered as developer at developer.bigcommerce.com and tried to add the key, but it gave me an invalid credentials message. What am I doing wrong?
I tried recreating this and it seems to be working fine. Did you make sure you added the store url too for the new api key.
Look at the attached screenshot.
Assuming you've inputed the user name and key correctly, you also want to be sure the store url matches the API URL given when you created the new user BUT without the /api/v2 at the end.
So if your API URL happened to be https://store-bwvr466.mybigcommerce.com/api/v2
Just input https://store-bwvr466.mybigcommerce.com for the store url

Tumblr API - OAuth issues: OAuth verifier and RESTConsole

Trying to obtain blog followers using Tumblr's API and RESTConsole in Chrome (not building an app, just want to check a request response).
I'm new to Tumblr's API and to RESTConsole, so two sources of possible error here.
I've already ...
Registered an app on Tumblr, receiving OAuth Consumer Key and Secret Key in the process.
Entered into REST Console my target: http://api.tumblr.com/v2/blog/{blogname}.tumblr.com/followers
Entered into REST Console's "Setup oAuth" window my OAuth Consumer Key and Secret Key, along with Tumblr's Request Token URL, Access Token URL and Authorize URL.
Approved read/write access to my application when prompted by Tumblr.
Entered the provided Token Key and Token Secret into REST Console's oAuth window.
When I attempt GET requests for follower counts (on my own blog or others'), Tumblr returns 401, "Not Authorized." My blog's preferences page lists the application I'm trying to use as having access.
I've tried this placing base-hostname:{blogname}.tumblr.com in REST Console's request parameters fields; I receive the same error. I tried running a different OAuth method from Tumblr's API (queued posts) and receive the same error.
Help?
Thanks. Let me know if this isn't clear.
Edit: Sorry, meant to add -- I think I may need Oauth Verifier. I haven't been able to find this token, or understand how to obtain it.
Edit (2): So, turns out Tumblr's API needs a comma separator from the REST Console. Thanks all.
''
Zack
$conskey = "CONSUMER KEY";
$conssec = "CONSUMER SECRET";
$tumblr_blog = "myblog.tumblr.com";
$to_be_posted = "This is the text to be posted";
$oauth = new OAuth($conskey,$conssec);
$oauth->fetch("http://api.tumblr.com/v2/user/following", array('offset'=>0) ,OAUTH_HTTP_METHOD_GET);
$result = json_decode($oauth->getLastResponse());
foreach($result->response->blogs as $key){
echo $key->url;
}
The code above will retrieve your followers list.
Hope this helps.

Flickr API: API key keeps getting invalid?

I’ve a Flickr which I’m using to upload pictures from my phone and all images are public. On my blog I want to retrieve all the images to show and for that I’ve first tried to create an application to get my API key. I’m using the Flickr API flickr.people.getPublicPhotos. This API service is said to not require authentication and putting it all together I end up with this call:
http://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key=fc94274cd0335f3c171fe22c8490b7d9&user_id=5545356%40N04&extras=description%2Cdate_upload%2Cdate_taken%2Cowner_name%2Coriginal_format%2Ctags%2C+o_dims%2C+views%2C+media%2C+path_alias%2C+url_sq%2C+url_t%2C+url_s%2C+url_q%2C+url_m%2C+url_n%2C+url_z%2C+url_c%2C+url_l%2C+url_o&per_page=40&format=php_serial&api_sig=0c48e2b6b6d9a03521e5ca86a15cf471
The problem is that every around 10 hours I fails and returns the error message a:3:{s:4:"stat";s:4:"fail";s:4:"code";i:100;s:7:"message";s:31:"Invalid API Key (Key not found)";}
I tried to create the API call when logged in to Flickr and also with not logging in and in both cases I get the error message. It’s like the API key expires or stops working. Have a missed something on Flickr about the API key or what could cause this? It is really frustrating to renew the URL twice at day.
Thank you
Sincere
- Mestika
If I read the docs correctly, the &api_sig query string parameter is constructed using an authentication token, one that eventually expires. Remove that parameter (= do not sign your API request) and I think you'll be OK.
Mestika's comment seems correct. I was getting the same problem when using the API explorer. If you use your accounts API, or go in and create a new app, then use the API given for that, then the key doesn't change every few hours.
The url to request a key is:
http://www.flickr.com/services/apps/create/apply
I got the same problem.
This is how i solved it:
removed the auth_token and the api_sig parameters
replaced the api_key value with an app key
Hope this helps.
i met this issue before. with new api key, only accept https request.
Let's change your url to: https://api.flickr.com/services/rest/?method=flickr.people.getPublicPhotos&api_key.....
I am sure it will be work right know.
thanks

Http 500 Internal Server Error with Amazon Product Advertising API

I am trying the Amazon Product Advertising API, following their tutorial here.
Before doing any coding, I am attempting to follow the tutorial and use the Signed Requests Helper form online to prove the concept. I enter in my Access Key ID and Secret Access Key, and then enter in the following in the Unsigned URL box:
_http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService
&Version=2010-11-01
&Operation=ItemSearch
&SearchIndex=Books
&Keywords=harry+potter
I copy and paste the contents of Signed URL box into my browser's address bar (with correct access key and signature):
_http://ecs.amazonaws.com/onca/xml?AWSAccessKeyId=[MY_ACCESS_KEY]&Keywords=harry%20potter&Operation=ItemSearch%0D&SearchIndex=Books%0D&Service=AWSECommerceService%0D&Timestamp=2011-05-30T07%3A56%3A17.000Z&Version=2010-11-01%0D&Signature=[MY_SIGNATURE]
In return I get a HTTP 500 Internal Server Error.
(Note I have inserted the unscore before both example hyperlinks as stackoverflow won't allow more than 2 hyperlinks for newbies.)
I've tried IE8, and Chrome, and have also tried the .co.uk domain as I reside in the UK. I have also looked at the AWS forum with no luck. Any help would be appreciated...
I have tried generating Signed URL with the page you linked to using my Access Key ID and Secret Access Key and I do get the correct response.
One thing I noticed is that your signed URL contains an extra character (%0D - newline character?) ending some of your request parameters values. Were these characters been added when you copied the sample URL in the unsigned URL input? Please try fixing the unsigned URL until these characters do not show up in the signed URL box, then try that signed URL again.