Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Invalid Consumer key error

Hi,

 

I am trying to call get resource rest api but getting "Invalid consumer key" error though i have already doubled checked my consumer key on manage application portal and it is correct. 

 

Here is get url i am trying to access :

https://api.fitbit.com/1/user/-/body/log/weight/date/\(dateString).json

 

language : Swift 

 

let headers = [

            "Authorization":"OAuth oauth_consumer_key=\(Fitbit["consumerKey"]!),oauth_token=\(Fitbit["oauthToken"]!),oauth_nonce=,oauth_signature=\(signature),oauth_signature_method=HMAC-SHA1,oauth_timestamp=\(timeStamp),oauth_version=1.0"

        ]

        

        Alamofire.request(.GET, postEndpoint, headers: headers)

            .responseJSON { response in

                print(response)

        }

 

This is the errror i am getting in response. am i passing wrong header type ?

 

SUCCESS: {

    errors =     (

                {

            errorType = oauth;

            fieldName = "oauth_consumer_key";

            message = "Invalid consumer key: null";

        }

    );

    success = 0;

}

 

Any kind of help would be greatly appreciated.

 

 

 

Best Answer
0 Votes
1 REPLY 1

I think you are very likely not sending a consumer key. Can you take a look at the raw HTTP request you are generating and verify the Authorization header contains your consumer key?

Best Answer
0 Votes