11-03-2015 22:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-03-2015 22:29
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.

- Labels:
-
OAuth 1.0a
11-04-2015 11:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
11-04-2015 11:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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?

