Reputation: 6351
I have the following code to get the images from urls
params = {'client_id':settings.SOCIAL_AUTH_INSTAGRAM_KEY,
'client_secret':settings.SOCIAL_AUTH_INSTAGRAM_SECRET,
'aspect':'media',
'object_id':instance.hashtag,
'callback_url':'http://localhost:8000/campaigns/hook'}
response = requests.post('https://api.instagram.com/v1/subscriptions/',
params=params)
I am using the requests library for sending the post request. But It returns the error message
"Invalid format for \"callback_url\". URL must","start with \"http:\/\/\" or \"https:\/\/\""
I have no idea i am receiving this message. I am sending the request the following url .
What is the difference btw http%3A%2F%2F and http:\/\/\
Any ideas?
Upvotes: 1
Views: 2364
Reputation: 1121486
You need to use the data
parameter to post data:
response = requests.post('https://api.instagram.com/v1/subscriptions/',
data=params)
The params
keyword is for GET
parameters only.
You must use a publicly reachable callback URL; http://localhost
is not a URL Instagram can reach.
Upvotes: 2