I've attempted all solutions (that appear to make sense) from:
And I looked through a handful of other posts that don't apply.
I'm using the Serverless framework to generate my backend. It uses API Gateway with AWS lambda and DynamoDB. In have 4 other API call's that work perfectly, it's only this one call that gives me problems.
Calling code:
//code that calls it
apiClientFactory = new ApiClientFactory();
apiClientFactory.credentialsProvider(credentialsProvider);
accountApiClient = apiClientFactory.build(DevsupercoolsoftwareClient.class);
...
public static InviteCodeResponseModel createInviteCode(InviteCodeRequestModel request) {
//request has one value, which is set to "USER"
InviteCodeResponseModel response = accountApiClient.accountInviteCodeGet(request);
return response;
}
Error:
Caused by: com.amazonaws.mobileconnectors.apigateway.ApiClientException: {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.\n\nThe Canonical String for this request should have been\n'POST\n...\n"}
(Service: DevsupercoolsoftwareClient; Status Code: 403; Error Code: null; Request ID: bd8d4c91-7758-11e6-a0a0-69136ab6b7af)
at com.amazonaws.mobileconnectors.apigateway.ApiClientHandler.handleResponse(ApiClientHandler.java:255)
at com.amazonaws.mobileconnectors.apigateway.ApiClientHandler.invoke(ApiClientHandler.java:88)
at java.lang.reflect.Proxy.invoke(Proxy.java:393)
at $Proxy1.accountInviteCodeGet(Unknown Source)
at com.camhart.supercoolsoftware.communicator.BackendCommunicator.createInviteCode(BackendCommunicator.java:62)
at com.camhart.supercoolsoftware.activities.Devices.triggerShareMenu(Devices.java:159)
at com.camhart.supercoolsoftware.activities.Devices.access$100(Devices.java:27)
at com.camhart.supercoolsoftware.activities.Devices$2.doInBackground(Devices.java:134)
at com.camhart.supercoolsoftware.activities.Devices$2.doInBackground(Devices.java:128)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
... 4 more