Should I use a library or do it manually?
I work with http://www.withings.com/api in Python.
To perform some requests, OAuth authentication is required. I used the requests library and obtained an oauth token and secret token, alongside my consumer and consumer secret tokens.
I am running into problems. The format for the request I need to make is as follows:
http://wbsapi.withings.net/notify?action=subscribe
&callbackurl=http%3a%2f%2fwww.yourdomain.net%2fyourCustomApplication.php
&comment=Your%20Own%20Application%20Description
&oauth_consumer_key=c331c571585e7c518c78656f41582e96fc1c2b926cf77648223dd76424b52b
&oauth_nonce=accbac1b7ee2b86b828e6dc4a5a539b2
&oauth_signature=XfobZMboIg2cRyNKAvyzONHHnKM%3D
&oauth_signature_method=HMAC-SHA1
&oauth_timestamp=1311842514
&oauth_token=887557411788d5120537c6550fbf2df68921f8dd6f8c7e7f9b441941eb10
&oauth_version=1.0
&userid=831
Seemingly a typical format with OAuth, except for the userid at the end.
Is it possible for me to make a request like this using the requests (or another) library? How do I get the URL right, with the comment and userid and callbackurl fields? Or do I need to generate this URL manually? If so, what's the best way?
EDIT
I understand 98% of the code I am being referred to. I only have a problem at the end.
So here I am, with the following code:
from __future__ import unicode_literals
from urlparse import parse_qs
import requests
from requests_oauthlib import OAuth1Session
consumer_key = '**Valid consumer key**'
consumer_secret = '**Valid consumer secret**'
oauth_key = '**Valid oauth key obtained through requests library and OAuth workflow**'
oauth_secret ='**Valid oauth secret obtained through requests library and OAuth workflow**'
verifier = '**Valid consumer key obtained through