Unable to add new Target on CRS

0 votes
asked Mar 3, 2018 by surender (230 points)
I have a basic sdk license and 14 day trial on CRS NA.

So I have three keys:




I am using the POST method for application/json and sending appKey as B but I always get this response:

                                                                           { "statusCode" : 1,
                                                                             "result" : {
                                                                               "message" : "invalid app key"
                                                                             "date" : "2018-03-03T14:06:03.031Z"

I have created signature as required using cloud secret C and appKey B. On sending an empty picture, i get buffer empty as the message.

Please help if you can create new targets on crs.

1 Answer

+2 votes
answered Mar 3, 2018 by surender (230 points)
Best answer

Okay, I got this working. Let me leave a procedure for anyone struggling with the documentation:

First of all the two keys needed are cloud-key and cloud-secret.

You need date in this format:

"yyyy-MM-dd'T'HH:mm:ss.xxxZ" called the ISO-8601 date string. (For Android)
String formattedDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.530Z").format(new Date());
Now you need to create a string like this:(I am using Android in java)
String signing = "active1appKey"+getString(R.string.cloud_key)+"date"+formattedDate+"image"+encodedString+"meta"+videoUrl+"name"+targetName+"size20typeImageTarget"+getString(R.string.cloud_secret);
For image's encoded String(where mCurrentPhotoPath is AbsolutePath in string format):
String encodedString= null;
try {
    encodedString = Base64.getEncoder().encodeToString(
} catch (IOException e) {
Next you need to sha1 hash it:
String hashCode= new String(Hex.encodeHex(DigestUtils.sha1(signing)));
Next construct a jsonObject:
JSONObject params = new JSONObject();
try {
    params.put("image",encodedString );
    params.put("active", "1");
} catch ( JSONException e) {
Next have params.toString() and you will get the jsonString.
Then just use this in the body and make a POST request to the cloud server url ending in port 8888.
You can use these resources for understanding better, they are from EasyAR but are not listed on the site and have java, go examples:
commented Nov 10, 2019 by jonnes82 (140 points)
Hi man, great answer...
where is the date, dont should be "timestamp"?
I have made a lot of combinations but doesnt work... i always give "Invalid signature"
i´m using C# in Unity

thank you
commented May 29 by bhaktimonsterar (120 points)
Hi jonnes82, do you already have an answer to your question? I have the same problem as you had
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.