[Group Management] API access for device's group list
Description
API access for location object's group list.
API
API CODE : api.common.group.get.object.group.list
HOST : http://cms.catchloc.com/api.partner.common.php
Method : GET
Protocol : JSON
Parameters
api : api_code
api_key : Client's partner key
timestamp : Unix timestamp
cert_key : Certification Key
member_key : HASH KEY for device authorization
Response
group_name : Group Name
group_key : Group Key
reg_date : Registered Date
Example
===== Request =====
http://cms.catchloc.com/api.partner.common.php?
api=api.common.group.get.list&
api_key=xxxxx&
timestamp=1513319595&
cert_key=xxxxxx
===== Response =====
- Success
[
{
"group_name":"***********",
"group_key":"***********",
"reg_date":1475815151
},
......
]
- Fail
{
"result":"FAIL",
"message":"Reason"
}
===== Request =====
String member_key = "MEMBER_KEY for applied target";
CatchLoc catchloc = new CatchLoc();
catchloc.setApiKey("API KEY");
catchloc.setServerKey("SERVER KEY");
JSONObject result = catchloc.getGroupsWithObject(member_key);
===== Response (JSONObject) =====
{
"result" : "ok",
"type" : "jsonarray"
"message" : API Response Body
}
===== Request =====
import CatchLocSDKForAPI (common)
CatchLocAPI.shared.setApiKey(API_KEY)
CatchLocAPI.shared.setserverKey(SERVER_KEY)
-MEMBER_KEY : MEMBER_KEY to be applied
CatchLocAPI.shared.getGroupsWithObject(memberKey: MEMBER_KEY)
{ result in
let jsonData = result.response
or
let jsonString = result.description()
}
===== Response =====
{
"response" : API Response Body
}
===== Request =====
$member_key = 'MEMBER_KEY for applied target';
$catchloc = new CatchLoc();
$catchloc->setApiKey("API KEY");
$catchloc->setServerKey("SERVER KEY")
$result = $catchloc->getGroupsWithObject($member_key);
===== Response (JSON String) =====
"{
"result" : "ok",
"type" : "array"
"message" : API Response Body
}"
===== Request =====
var callback = function(json)
{
code... (handle for api response)
(e.g. : create marker on map or print list)
};
var params =
{
member_key: 'MEMBER_KEY for applied target',
};
CatchLoc.setApiKey("API KEY");
CatchLoc.setServerKey("SERVER KEY");
CatchLoc.getGroupsWithObject(params, callback);
===== Response (JSON, using parameter in callback function) =====
{
"result" : "ok",
"type" : "array"
"message" : API Response Body
}