Free Support Forum - aspose.com

REST API usage and validating signature calculation

Hello,

I am evaluating the Aspose REST API, and would like to use it with some different languages than you currently offer for SDKs and examples in the documentation. I’ve been testing for now with just a simple bash script making use of curl. I’m attempting to get usage for the current period at http://api.aspose.com/1.1/usage/currentPeriod , but I’m getting a 404 Not Found. However, no matter what endpoint I try, I only get 404s.

Could you please check my logic to see if I’m calculating the signature correctly? If it helps, I can send the appSID and key for you to test on your end. Also, since I’m getting 404, are the endpoints not correct?

Here’s my bash script:

#!/bin/bash
appsid="myappsid"
key="mykey"
preurl="http://api.aspose.com/1.1/usage/currentPeriod?appSID=$appsid"
sha=$(echo -n $preurl | openssl dgst -sha1 -hmac $key | sed -e “s/^.*= //”)
curl -G -H “Accept: application/xml” “$preurl” --data-urlencode “signature=$sha”

The other language I’m testing with is getting a 404 as well, so either my signature calculation is wrong, or the endpoints are wrong. Any help you can provide is welcomed.

Hi,


Thank you for contacting support. We have tested Aspose cloud service and it returns an excel of recent logs. Please check how to sign a URL under the callAPI method: Sign URL

Thank you for the reply Imran, but it is not very helpful for my application.

I’ve read the PHP, Python, Perl, Java, and Node methods for signing, so having me look at those examples isn’t telling me why my specific bash/Linux example is not working. I do not intend to use your API with any of these languages for which you currently provide examples. If I can’t get the product to work with my languages of choice – after all REST is just HTTP and should work from any language – then I’ll have to remove it from consideration.

Why am I getting a 404 if that base URL exists? I could understand it being 400 if the appSID or signature param values are incorrect, but not 404.

Shouldn’t I send you the appSID and the key for you test directly with the bash example I’ve provided?

Thanks,
Clay


Hi Clay,


Thank you for the inquiry. We have documented the way of signing a URL. Please check this help topic: Request Format. If this does not help, then please provide us your registered email ID against the Aspose cloud service. We’ll investigate and reply you appropriately.
clayredding:
Shouldn’t I send you the appSID and the key for you test directly with the bash example I’ve provided?
Sure, you may also send AppSID, AppKey and a sample of your signed URL. Please check how to send the confidential files to a staff member via an email: Send your License File to an Aspose Staff Member

Hi Imran,


Thanks for sending that link, but it has actually been my reference all along. So, despite following that, something else is going wrong.

I’ve emailed you my appSID and app key so that you can troubleshoot.

Thanks,
Clay

Hi Clay,


Thank you for sending AppSID and AppKey. It appears as your signature parameter is not being calculated correctly. You may also navigate to the Aspose for Cloud API page, enter AppSID, AppKey and calculate Signature parameter. We’re also investigating logs and will let you know in case of any available feedback.
:
It is missing ‘v’ in the URL.
Correct URL: http://api.aspose.com/v1.1/usage/currentPeriod