Table of Contents

Modify target image properties | PUT /target/<target_id>

Modify the target image properties corresponding to target_id. Parameters are modified in HTTP patch form, and unchanged parameters remain unchanged.

Action

PUT /target/<target_id>

Authentication

Required

Http Header

Content-Type=application/json

HTTP Header: Authorization (when API Key Token authentication is used)

Request parameters

Field Type Required Description
image String(base64) Yes Base64-encoded string of the image content. JPG and PNG images are supported. The maximum image size is 2MB.
active String No "1" to enable the target, "0" to disable the target. The default is "1".
name String Yes Target name. Only English letters, English punctuation, and digits are supported. The minimum length is 1 character and the maximum length is 64 characters.
size String(Float) Yes Recognition image width (unit: cm). The height of the recognition image is automatically calculated by the system according to the uploaded image. The size of the recognition image corresponds to the size of the virtual content. Default: 20.
meta String Yes Generally used to store AR content information in text string format. The default is "". For example: JSON information of the recognized object, base64 encoding of an image, or a URL download address for a large file in cloud storage. Maximum 2MB.
type String (Float) Yes Must be fixed as the string "ImageTarget". The letter case must be exactly the same.
allowSimilar String No Whether to force adding when similar images exist. Default: 0. Similar images may affect recognition results, so the default is recommended.
Note
  • image maximum limit: 2MB.
  • meta maximum limit: 2MB.

Request example

    PUT /target/e61db301-e80f-4025-b822-9a00eb48d8d2 HTTP/1.1
    Host:
    Date: Mon, 1 Jan 2018 00:00:00 GMT
    Content-Type: application/json
    {
        "active":"1",
        "name":"easyar",
        "size":"5",
        "meta":"496fbbabc2b38ecs3460a...",
        "timestamp": 1514736000000,
        "appKey": "test_app_key",
        "signature": "89985e2420899196db5bdf16b3c2ed0922c0c221"
    }

Response example

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

Response fields

Field Description
statusCode Status code. 0 indicates that authentication is correct. For more information, see Status codes.
result Error message or target image information
timestamp Server-side time when the response is returned. Uses Unix timestamp format in milliseconds
result.targetId Unique ID of the target image
result.trackingImage Base64-encoded string of the tracking image
result.name Target name
result.size Recognition image width (unit: cm). The height of the recognition image is automatically calculated by the system according to the uploaded image. The size of the recognition image corresponds to the size of the overlaid virtual content
result.meta Base64-encoded additional information, such as a string generated by base64-encoding a JSON string
result.type Fixed as ImageTarget
result.active "1" enabled, "0" disabled

Error codes

See Status codes and error codes