AppKey error using python requests

3 posts / 0 new
Last post
rees.shane
AppKey error using python requests

Hi All,

Using python I keep getting this error "The AppKey submitted with this request is invalid."

I have been using the Consumer Key for my program but that is the result I get.

data={

    'key' : 'pJxgwWSyGTB71sA8SjKWt6NE4bUUGe", #2 letter / numbers has been removed so no one can use it

    "from": start,

    "to": finish

}

headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}

 

r = requests.post('http://open.mapquestapi.com/directions/v2/route', json = data, headers=headers)

print(r.content.decode())

 

Can anyone assist in why I get this error? I've made 4 keys and none work.

 


rees.shane
Sorted

Seems you can send your key via JSON as per the documents 


MQBrianCoakley
Make sure the key is in the
Make sure the key is in the url rather than the post body.