I am trying to integrate the web rest API in the android project, before that I am trying to run in postman but I am getting the error { "code": "access.not.granted", "message": "Access not granted" } ,I have given the application key and hmac key from the application page which I have created and can you please provide me android project sample with rest api integrated.
-the src\recognizer\CryptoHelper.js file contains a computeHmac function
-then, you can refer to other files, such as src\recognizer\rest\v3\Cdkv3RestTextRecognizer.js that show how to compute the input data with the computeHmac function
thanks for the reply Olivier, what my question I do know how to integrate api ,but I was asking more specific to MyScript rest api sample in android, because I need to provide the request body as well response body based on json,thanks.
O
Olivier @MyScript
said
almost 3 years ago
Dear Yahya,
I am not sur to understand what you mean.
Usually, the "Access not granted" error message occurs when the hmac key is not properly computed.
In a first time, you can disable the hmac key in your dahsboard, so that you should no longer get the error message:
Thanks for the response, So it works now as I disabled the HMAC in my cloud application pages, my question is it okay if we use the hmac key and app key provided in the application please refer image or I have to compute the HMAC with the function provided, if the answer is yes that I need to compute please provide a snippet how as we need to make the project go live in coming days.
-the src\recognizer\CryptoHelper.js file contains a computeHmac function
-then, you can refer to other files, such as src\recognizer\rest\v3\Cdkv3RestTextRecognizer.js that show how to compute the input data with the computeHmac function
yahya basique
I am trying to integrate the web rest API in the android project, before that I am trying to run in postman but I am getting the error { "code": "access.not.granted", "message": "Access not granted" } ,I have given the application key and hmac key from the application page which I have created and can you please provide me android project sample with rest api integrated.
Dear Yahya,
the way to compute the hmac key is all indicated in this link: https://developer.myscript.com/support/account/registering-myscript-cloud/#computing-the-hmac-value
You can also refer to the source of the MyScriptJS library: https://github.com/MyScript/MyScriptJS:
-the src\recognizer\CryptoHelper.js file contains a computeHmac function
-then, you can refer to other files, such as src\recognizer\rest\v3\Cdkv3RestTextRecognizer.js that show how to compute the input data with the computeHmac function
Best regards,
Olivier
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstOlivier @MyScript
Dear Yahya,
currently, doing a simple REST request on Android is not different than on any other plateform.
Just format it properly, and post it to our server. If your postman request works fine, it should not be different on Android:
https://stackoverflow.com/questions/8267928/android-rest-client-sample
https://developer.myscript.com/docs/interactive-ink/1.3/web/rest/architecture/
Best regards,
Olivier
yahya basique
thanks for the reply Olivier, what my question I do know how to integrate api ,but I was asking more specific to MyScript rest api sample in android, because I need to provide the request body as well response body based on json,thanks.
Olivier @MyScript
Dear Yahya,
I am not sur to understand what you mean.
Usually, the "Access not granted" error message occurs when the hmac key is not properly computed.
In a first time, you can disable the hmac key in your dahsboard, so that you should no longer get the error message:
https://developer-support.myscript.com/support/discussions/topics/16000026525
https://developer-support.myscript.com/support/discussions/topics/16000028017
If this work, in a second time, you shall compute it as follows: https://developer.myscript.com/support/account/registering-myscript-cloud/#computing-the-hmac-value
Best regards,
Olivier
yahya basique
Thanks for the response, So it works now as I disabled the HMAC in my cloud application pages, my question is it okay if we use the hmac key and app key provided in the application please refer image or I have to compute the HMAC with the function provided, if the answer is yes that I need to compute please provide a snippet how as we need to make the project go live in coming days.
Olivier @MyScript
Dear Yahya,
the way to compute the hmac key is all indicated in this link: https://developer.myscript.com/support/account/registering-myscript-cloud/#computing-the-hmac-value
You can also refer to the source of the MyScriptJS library: https://github.com/MyScript/MyScriptJS:
-the src\recognizer\CryptoHelper.js file contains a computeHmac function
-then, you can refer to other files, such as src\recognizer\rest\v3\Cdkv3RestTextRecognizer.js that show how to compute the input data with the computeHmac function
Best regards,
Olivier