Table Of Contents

Previous topic

Quick start with EasyAR CRS –Hello World

Next topic

Best practice for adding new target image

Get started with Target Management API

Targets in Cloud Database can be managed using either the WebUI Cloud Target Manager or the Web Services API.

EasyAR also provides Target Management SDK for developers by following languages:

The tuple <Cloud Key, Cloud Secret and URLs>

Before you manage the target images, you have to create a new Cloud Database in CRS.

step 1) Login account -> Developer Center -> CRS,

step 2) create new Cloud Database then,

step 3) show the tuple of the Cloud Database:

  • Cloud Key
  • Cloud Secret
  • Cloud URL
    • Server-end URL: For target management
    • Client-end URL: For client to recognize image

Web Service API

CRS API uses HTTP REST transport standard. The parameters include:

  • Common signature parameters

    • Date time: date
    • API key: appKey
    • Request signature: signature
  • API command parameters

    Common signature parameters are must, and API command’s parameters may be optional in GET/DELETE requests.`

Use tuple<key, secret, server-end url> to invoke the web service API.

Refer Signing Example for more details about API authentication.

Example: Add new target

Here is a example of adding new target image, helping developers using the API

Please refer Best practice for adding new target to build your product release.

Request to add new target:

POST /targets/ HTTP/1.1
Host:
Date: Mon, 1 Jan 2018 00:00:00 GMT
Content-Type: application/json
{
    "image":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgM...",
    "active":"1",
    "name":"easyar",
    "size":"5",
    "meta":"496fbbabc2b38ecs3460a...",
    "type":"ImageTarget",
    "timestamp": 1514736000000,
    "appKey": "test_app_key",
    "signature": "89985e2420899196db5bdf16b3c2ed0922c0c221"
}

Response:

HTTP/1.1 200 OK
Content-Type: application/json
{
    "statusCode": 0,
    "result": {
        "targetId":"e61db301-e80f-4025-b822-9a00eb48d8d2",
        "trackingImage":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgM...",
        "name": "easyar",
        "size": "5",
        "meta": "496fbbabc2b38ecs3460a...",
        "type": "ImageTarget",
        "modified":1514735000000
        "active":"1",
        "trackableRate": 0,
        "detectableRate": 0,
        “detectableDistinctiveness”:0,
        "detectableFeatureCount", 0,
        "trackableDistinctiveness", 0,
        "trackableFeatureCount", 0,
        "trackableFeatureDistribution", 0,
        "trackablePatchContrast", 0,
        "trackablePatchAmbiguity", 0
    },
    "timestamp": 1514736000000
}

Detailed description of response field, please refer the Chapter: Response field.

Next Reference: