i'n trying to do some request on the MapMyFitness
API (Oauth2).
I can get my Authorization Code
with the oauth2 identification, but now i need to request to some route.
Here is the request :
Alamofire.request(self.oauthClient.baseURL() + "workout/",
method: .get,
parameters: nil,
headers: authorizationHeader
)
.validate()
.responseData { [weak self] (response) in
switch response.result {
case .success(let data):
do {
let jsonResponse = try JSON(data: data)
success(items);
self?.isLoading = false;
} catch {
self?.isLoading = false;
failed(nil)
}
break;
case .failure(let error):
print(error);
self?.isLoading = false;
failed(error)
break;
}
}
In the header here is the authorization code like this :
"Authorization": "Bearer ***********************************"
Here is the doc about the route API : https://developer.underarmour.com/docs/v71_Workout
Alamofire error:
responseValidationFailed(Alamofire.AFError.ResponseValidationFailureReason.unacceptableStatusCode(403))
Am i missing something ? Thx