Cloud Recognition APIs
[ Instructions ]
Before start to use the APIs, you need to do the following process on the developer plaform:
- Register: https://cloud.voidar.net/develop/registerp
- Login: https://cloud.voidar.net/develop/loginp
- Create a new cloud database, then get the
accessKeyandapiKeyof this database.
[ Interface Specification ]
All of the APIs are using http post to access. The format of requesting parameters and results is in json format, and you need to add “Authorization” to your http header for access authority, the format of setting is “accessKey:apiKey”. Moreover, you need to add “Content-Length” for data length setting. Please check the demo for details.
Demo download: WebapiDemo.zip (3.74 MB)
Note
Demo Instructions: Install jdk1.8 and eclipse, then import demo to eclipse (File->Import...->General->Existing Projects into Workspace->Next)
1. Upload Target Image
description: upload a single target image to cloud database
url: https://cloud.voidar.net/develop/ws/uploadTarget.do
request parameters:
| name | type | required | remark |
|---|---|---|---|
| name | string | Y | image name,not null,maximum length is 50 characters |
| metadata | string | Y | custom data,can be null,base64 encoding is required,maximum length is 2000 characters |
| imagedata | string | Y | image data,not null,base64 encoding is required,maximum size is 2M |
Json data:
{"name":"10.jpg","metadata":"dGVzdA...","imagedata":"4AAQSkZJRgA..."}
result:
- success:
{
"code":"0",//return 0 for success
"msg":"success",//return message
"image":{//image details
"id":3521,//image ID
"name":"10.jpg",//name
"metadata":"test",//custom data
"rating":5,//recognition score(1-worst 2-bad 3-fair 4-good 5-best)
"bundle":"0,0,0,0",//assetbundle bound state(ios,android,windows,mac), equal to 0 indicates unbound,greater than 0 indicates bound
"createTime":"2016-03-30 14:11:19"//uploaded time
}
}
- failure:
{
"code":"1",//return 1 for failure
"msg":"failure"//return message
}
demo: AddTarget.java
2. Get Target Image List
description: get targets list from cloud database
url: https://cloud.voidar.net/develop/ws/targetList.do
request parameters:
| name | type | required | remark |
|---|---|---|---|
| start | int | Y | start index |
| num | int | Y | number of records,maximum value is 20 |
Json data:
{"start":0,"num":10}
result:
- success:
{
"code":"0",//return 0 for success
"msg":"success",//return message
"total":1,//total amount of image
"data":[{//image details
"id":3521,//image ID
"name":"10.jpg",//name
"metadata":"test",//custom data
"rating":5,//recognition score(1-worst 2-bad 3-fair 4-good 5-best)
"bundle":"0,0,0,0",//assetbundle bound state(ios,android,windows,mac), equal to 0 indicates unbound,greater than 0 indicates bound
"createTime":"2016-03-30 14:11:19"//uploaded time
}]
}
- failure:
{
"code":"1",//return 1 for failure
"msg":"failure"//return message
}
demo: TargetList.java
3. Upload assetbundle
description: Upload the assetbundle file built in Unity to cloud database, and bind the file with corresponding image marker.
url: https://cloud.voidar.net/develop/ws/uploadBundle.do
request parameters:
| name | type | required | remark |
|---|---|---|---|
| id | long | Y | image ID |
| platform | int | Y | 1-ios 2-android 3-windows 4-mac |
| bundle | string | Y | assetbundle data,not null,base64 encoding is required,maximum size is 2M |
Json data:
{"id":3521,"platform":1,"bundle":"VW5pdHlXZ..."}
result:
- success:
{
"code":"0",//return 0 for success
"msg":"success"//return message
}
- failure:
{
"code":"1",//return 1 for failure
"msg":"failure"//return message
}
demo: UploadBundle.java
4. Get Target Image Details
description: get target image details from cloud database
url: https://cloud.voidar.net/develop/ws/targetDetail.do
request parameters:
| name | type | required | remark |
|---|---|---|---|
| id | long | Y | image ID |
Json data:
{"id":3521}
result:
- success:
{
"code":"0",//return 0 for success
"msg":"success",//return message
"image":{//image details
"id":3521,//image ID
"name":"10.jpg",//name
"metadata":"test",//custom data
"rating":5,//recognition score(1-worst 2-bad 3-fair 4-good 5-best)
"bundle":"2,0,0,0",//assetbundle bound state(ios,android,windows,mac), equal to 0 indicates unbound,greater than 0 indicates bound
"createTime":"2016-03-30 14:11:19"//uploaded time
}
}
- failure:
{
"code":"1",//return 1 for failure
"msg":"failure"//return message
}
demo: TargetDetail.java
5. Detele Target Image
description: delete target image from cloud database
url: https://cloud.voidar.net/develop/ws/deleteTarget.do
request parameters:
| name | type | required | remark |
|---|---|---|---|
| id | long | Y | image ID |
Json data:
{"id":3521}
result:
- success:
{
"code":"0",//return 0 for success
"msg":"success"//return message
}
- failure:
{
"code":"1",//return 1 for failure
"msg":"failure"//return message
}
demo: DelTarget.java
6. delete assetbundle
description: delete binded assetbundle
url: https://cloud.voidar.net/develop/ws/deleteBundle.do
request parameters:
| name | type | required | remark |
|---|---|---|---|
| id | long | Y | image ID |
| platform | int | Y | 1-ios 2-android 3-windows 4-mac |
Json data:
{"id":3521,"platform":1}
result:
- success:
{
"code":"0",//return 0 for success
"msg":"success"//return message
}
- failure:
{
"code":"1",//return 1 for failure
"msg":"failure"//return message
}
demo: DelBundle.java
7. Update Custom Data
description: update custom data of target image
url: https://cloud.voidar.net/develop/ws/updateMetadata.do
request parameters:
| name | type | required | remark |
|---|---|---|---|
| id | long | Y | image ID |
| metadata | string | Y | custom data,can be null,base64 encoding is required,maximum length is 2000 characters |
Json data:
{"id":3521,"metadata":test}
result:
- success:
{
"code":"0",//return 0 for success
"msg":"success"//return message
}
- failure:
{
"code":"1",//return 1 for failure
"msg":"failure"//return message
}
demo: UpdateMetadata.java
8. Get the detailed infomation based on marker's name
description: Get the detailed information based on marker's name from cloud database
url: https://cloud.voidar.net/develop/ws/targetDetailByName.do
request parameters:
| name | type | required | remark |
|---|---|---|---|
| name | string | Y | image name |
Json data:
{"name":"case1"}
result:
- success:
{
"code":"0",//return 0 for success
"msg":"",//return message
"image":{//image details
"id":3521,//image ID
"name":"10.jpg",//name
"metadata":"test",//custom data
"rating":5,//recognition score(1-worst 2-bad 3-fair 4-good 5-best)
"bundle":"2,0,0,0",//assetbundle bound state(ios,android,windows,mac), equal to 0 indicates unbound,greater than 0 indicates bound
"createTime":"2016-03-30 14:11:19"//uploaded time
}
}
- failure:
{
"code":"1",//return 1 for failure
"msg":"failure"//return message
}
demo: TargetDetailByName.java
9. code description
| code | remark |
|---|---|
| 0 | success |
| 1 | failure |
| 401 | Permission error (accessKey or apiKey error) |
| 999 | system error |