Auth
Get Server URL
Get server's URL for company.
1) request
Method | POST |
URL | https://{CloudURL or YourServer's URL}/openapi/1/server |
Body :
field name | type | description | option |
id | string | company owner's id(email) The company owner means the admministrator or owner in company information in adminWeb | mandatory |
hid | number | source host id(1~10). Each source host have to select a different value. A customer can have 10 hosts to connect to OpenAPI. | mandatory |
Example :
{
"id" : "owner@company.com",
"hid" : 1
}
|
2) response
field name | type | description | option |
ServerURL | string | API server's URL | mandatory |
Rand | string | API server's Random number | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
403 | Request forbidden. parameter invalid |
Example :
{
"ServerURL": "https://aa.aa.com"
"Rand": "452673a34b"
}
|
Get Session Key
After "/server" call, you have to call this just one time. Server's Random number will be reset.
1) request
Method | POST |
URL | {ServerURL}/openapi/1/auth |
Body :
field name | type | description | option |
id | string | company owner's id(ProPTT2 ID) | mandatory |
hid | number | source host id(1~10) in server command. | mandatory |
authKey | string | Lowercase(Base16(Sha512(Rand + '-' + company's interaction key)))
| mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
If Rand=12345678, interacionKey="bb00cc"
Lowercase(Base16(Sha512("12345678-bb00cc")))
= "7aeaef20455f726d8aa464c4fd57f670657dfea039585e7a6a1e5889537956a43f3a4600ee7eef
305f4f7e309792062cd01be49f6c0438007774347477feb558"
[ Java sample code ]
public static String encryptSha512(String str) {
String eip;
byte[] bip;
String resultStr = "";
try {
MessageDigest sha512 = MessageDigest.getInstance("SHA-512");
bip = sha512.digest(str.getBytes());
for (int i=0; i < bip.length; i++) {
eip = "" + Integer.toHexString((int)bip[i] & 0x000000ff);
if (eip.length() < 2) eip = "0" + eip;
resultStr = resultStr + eip;
}
} catch(Exception e) {
e.printStackTrace();
}
return resultStr;
}
String myAuthKey = encryptSha512("12345678-bb00cc");
[ PHP sample code ]
$authKey = strtolower(hash("sha512", "12345678-bb00cc"));
|
Example :
{
"id": "abc@proptt2.com",
"hid" : 1,
"authKey": "452673a34b"
}
|
2) response
field name | type | description | option |
sessionkey | string | session key. In server 3.1.2, this sesstion has 10 minute timeout. You can refer to the keepalive API. | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
401 | Authentication failure |
403 | Request forbidden. parameter invalid |
Example :
{
"sessionkey":"a34b56c21"
}
|
Keep Alive
This is for keeping session key. Please call this every 3 minute to keet seesion time.
1) request
Method | GET |
Required | Server 3.1.2 ~ |
URL | {ServerURL}/openapi/1/keepalive?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
401 | Authentication failure |
403 | Request forbidden. parameter invalid |
Channel
Get Channel List
1) request
Method | GET |
URL | {ServerURL}/openapi/1/channels?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start record index. 0 based. Server 9.0.x~ required. Optional |
pageSize | size to get. Server 9.0.x~ required. Optional |
Body : Nothing
2) response
field name | type | description | option |
channels | | | channel list | |
id | number | channel's ID | mandatory |
no | string | channel's No | mandatory |
name | string | channel's name | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Example :
{
"channels":[
{
"id" : 1,
"no" : "34",
"name" : "abc"
},{
"id" : 2,
"no" : "23",
"name" : "efg"
}
]
}
|
Get Channel Count
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/channels/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | channel count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Example :
Create Channel
1) request
Method | POST |
URL | {ServerURL}/openapi/1/channels?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
no | string | channel's No, It must be unique | mandatory |
name | string | channel's name | mandatory |
description | string | channel's description | |
notification | string | channel's notification | |
TOT | number | Time Over Time(10 ~ 600) | default 30 |
recordable | boolean | Is recordable in client-side? | default true |
encrypted | boolean | Is encrypted channel (Required Server 2.2.8 ~) | default false |
shareLocations | boolean | Is location shared channel (Required Server 3.3.0 ~) | default false |
status | number | 10:Normal, 80:Stopped (Required Server 5.1.0 ~) | |
dispatcherControl | boolean | controlled by dispatcher (Required Server 8.1.1 ~) | |
Example :
{
"no" : 123,
"name": "abc",
"description":"this is a good channel."
"notification":"welcome.",
"TOT":20,
"recordable":true,
"encrypted":false
}
|
2) response
field name | type | description | option |
id | number | created channel's ID | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
412 | Precondition failed, No is duplicated |
500 | Internal error |
Example :
Get Channel
1) request
Method | GET |
URL | {ServerURL}/openapi/1/channels/{cid}?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
no | string | channel's No | mandatory |
name | string | channel's name | mandatory |
description | string | channel's description | mandatory |
notification | string | channel's notification | mandatory |
TOT | number | Time Over Time | mandatory |
recordable | boolean | Is recordable? | mandatory |
encrypted | boolean | Is encrypted (Required Server 2.2.8 ~) | mandatory |
shareLocations | boolean | Is location shared channel (Required Server 3.3.0 ~) | |
leader | number | leader's user id | mandatory |
status | number | 10:Normal, 80:Stopped (Required Server 5.1.0 ~) | |
modified | boolean | Is modified (Required Server 7.1.3 ~) | |
dispatcherControl | boolean | controlled by dispatcher (Required Server 8.1.1 ~) | |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"no" : 123,
"name":"abc",
"description":"this is a good channel."
"notification":"welcome.",
"TOT":20,
"recordable":true,
"encrypted":true,
"leader":5
}
|
Update Channel
1) request
Method | PUT |
URL | {ServerURL}/openapi/1/channels/{cid}?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to update |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
name | string | channel's name | |
description | string | channel's description | |
notification | string | channel's notification | |
TOT | number | Time Over Time(10 ~ 600) | default 30 |
status | number | 10:Normal, 80:Stopped (Required Server 5.1.0 ~) | |
dispatcherControl | boolean | controlled by dispatcher (Required Server 8.1.1 ~) | |
Example :
{
"name": "abc",
"description":"this is a good channel.",
"Notification":"welcome.",
}
|
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Delete Channel
1) request
Method | DELETE |
URL | {ServerURL}/openapi/1/channels/{cid}?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to delete |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
403 | Forbidden-CrossConnect |
404 | Not Found |
500 | Internal error |
Example :
Purge All Channels
All channel information of Relay servers will be synced. Please note it could not be safe if it is called on service.
1) request (Required Server 7.1.3 ~)
Method | POST |
URL | {ServerURL}/openapi/1/channels/purgeAll?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Link User To Channel
1) request
Method | POST |
URL | {ServerURL}/openapi/1/channels/{cid}/users/{uid}?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to be link |
uid | user's ID to be linked. If the user is linked already, the link would be updated |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
role | number | user's role, 10:normal,20:Receiver,90:Operator, (Required Server 3.2.0 ~) | default 10 |
3) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Update User Of Channel
1) request
Method | PUT |
Required | Server 5.1.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/users/{uid}?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to be updated |
uid | user's ID to be updated |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
role | number | user's role, 10:normal,20:Receiver,90:Operator | default 10 |
Example :
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Unlink User To Channel
1) request
Method | DELETE |
URL | {ServerURL}/openapi/1/channels/{cid}/users/{uid}?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to be unlink |
uid | user's ID to be unlinked |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Get Users Of Channel
1) request
Method | GET |
URL | {ServerURL}/openapi/1/channels/{cid}/users?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start record index. 0 based. Server 9.0.x~ required. Optional |
pageSize | size to get. Server 9.0.x~ required. Optional |
Body : Nothing
2) response
field name | type | description | option |
users | | | user list | mandatory |
id | number | user's ID | mandatory |
strId | string | user's ProPTT2 ID(email) | mandatory |
name | string | user's name | mandatory |
type | number | user's type. 20: ProGate, 21: SIP device, 50: Normal, 70: Channel Leader, 80: Dispatcher, 90:Manager (Required Server 3.0.1 ~) | mandatory |
role | number | user's role, 10:normal,20:Receiver,90:Operator, (Required Server 3.2.0 ~) | default 10 |
level | number | user's level id(Required Server 5.1.0 ~) | |
phoneNumber | string | user's phoneNumber(Required Server 5.1.0 ~) | |
email | string | user's email(Required Server 5.1.0 ~) | |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"users":[
{
"id" : 1,
"strId" : "abc@company.ptt",
"name" : "abc",
"type" : 50,
"role" : 10
},{
"id" : 2,
"strId" : "efg@company.ptt",
"name" : "efg",
"type" : 50,
"role" : 20
}
]
}
|
Get User Count of Channel
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/users/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | user count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Get Records Of Channel(Server 2.2.8~)
1) request
Method | GET |
URL | {ServerURL}/openapi/1/channels/{cid}/records?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start record index. 0 based |
pageSize | size to get |
Body : Nothing
2) response
field name | type | description | option |
records | | | record list | mandatory |
id | number | record's ID | mandatory |
type | number | 10: AudioPTT, 20:VideoPTT, 31:VideoShared | mandatory |
status | number | 10: Normal | mandatory |
fileSize | number | file size(KB) | mandatory |
ownerId | number | owner id | mandatory |
ownerName | string | owner's name | mandatory |
createDate | string | created date | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"records":[
{
"id" : 1,
"type" : 10,
"status" : 10,
"fileSize" : 32,
"ownerId" : 1,
"ownerName" : "owner name",
"createDate" : "2017-11-02 04:29:02"
},{
"id" : 2,
"type" : 10,
"status" : 20,
"fileSize" : 40,
"ownerId" : 1,
"ownerName" : "owner name",
"createDate" : "2017-11-02 04:45:02"
}
]
}
|
Get Record Count of Channel
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/records/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | record count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Get Uploads Of Channel(Server 9.2.1~)
1) request
Method | GET |
URL | {ServerURL}/openapi/1/channels/{cid}/uploads?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start upload index. 0 based |
pageSize | size to get |
Body : Nothing
2) response
field name | type | description | option |
uploads | | | upload list | mandatory |
ownerId | number | owner id | mandatory |
seq | number | record's ID | mandatory |
type | number | 10: Normal | mandatory |
status | number | 10: Normal | mandatory |
ownerName | string | owner's name | mandatory |
playTime | number | play time. second | mandatory |
fileType | number | file type, 10: Video, Audio, 30:Picture | mandatory |
location | number | channel no | mandatory |
startDate | string | started date for all records | mandatory |
createDate | string | created date | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"uploads":[
{
"ownerId" : 1,
"seq" : 1,
"type" : 10,
"status" : 10,
"ownerName" : "owner name",
"playTime" : 60,
"fileType" : 10,
"location" : "132.827|37.3424",
"startDate" : "2017-11-02 04:29:02",
"createDate" : "2017-11-02 04:29:02"
},{
"ownerId" : 1,
"seq" : 2,
"type" : 10,
"status" : 10,
"ownerName" : "owner name",
"playTime" : 60,
"fileType" : 10,
"location" : "132.827|37.3424",
"startDate" : "2017-11-02 04:29:02",
"createDate" : "2017-11-02 04:30:02"
}
]
}
|
Get Upload Count of Channel
1) request
Method | GET |
Required | Server 9.2.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/uploads/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | upload count | mandatory(If success) |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Send a sync event to Channel
1) request
Method | POST |
Required | Server 5.1.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/sync?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to be synced |
id | company owner's id(email). It is a sender. |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Send a message to Channel
1) request
Method | POST |
Required | Server 1.2.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/sendMessage?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to get |
id | company owner's id(email). It is a sender. |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
messageId | number | message's id | mandatory |
messageContent | string | message to be sent. messageContent=Base64(message) | |
Example :
{
"messageId": 1,
"messageContent":"SGVsbG8="
}
|
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Send a SOS to Channel
1) request
Method | POST |
Required | Server 2.0.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/sendSOS?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to get |
id | company owner's id(email). It is a sender. |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Send an alert to Channel
1) request
Method | POST |
Required | Server 2.0.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/sendAlert?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to get |
id | company owner's id(email). It is a sender. |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
messageId | number | message's id | mandatory |
messageType | number | message's type. 0:General | mandatory |
messageContent | string | message to be sent. messageContent=Base64(message) | |
Example :
{
"messageId": 1,
"messageType": 0,
"messageContent":"SGVsbG8="
}
|
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Send a custom message to Channel
1) request
Method | POST |
Required | Server 2.0.x ~ |
URL | {ServerURL}/openapi/1/channels/{cid}/sendCustomMessage?id={userid}&hid={hostid}&skey={sessionkey} |
cid | channel's ID to get |
id | company owner's id(email). It is a sender. |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
messageId | number | message's id | mandatory |
messageContent | string | message to be sent. messageContent=Base64(message) | |
Example :
{
"messageId": 1,
"messageContent":"SGVsbG8="
}
|
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
User
Get User List
1) request
Method | GET |
URL | {ServerURL}/openapi/1/users?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start record index. 0 based. Server 9.0.x~ required. Optional |
pageSize | size to get. Server 9.0.x~ required. Optional |
Body : Nothing
2) response
field name | type | description | option |
users | | | user list | mandatory |
id | number | user's ID | mandatory |
strId | string | user's ProPTT2 ID(email) | mandatory |
name | string | user's name | mandatory |
type | string | user's type. 20: ProGate, 21: SIP device, 50: Normal, 70: Channel Leader, 80: Dispatcher, 90:Manager (Required Server 3.0.1 ~) | mandatory |
latitude | string | user's last latitude. (Required Server 1.2.x ~) | |
longitude | string | user's last longitude. (Required Server 1.2.x ~) | |
locationDate | string | last update date of user's location. (Required Server 1.2.x ~) | |
level | number | user's level id(Required Server 5.1.0 ~) | |
phoneNumber | string | user's phoneNumber(Required Server 5.1.0 ~) | |
email | string | user's email(Required Server 5.1.0 ~) | |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Example :
{
"users":[
{
"id" : 1,
"strId" : "abc@company.ptt",
"name" : "abc",
"type" : 50,
"latitude":"37.4898",
"longitude":"127.033",
"locationDate":"2016-07-21 05:42:35"
},{
"id" : 2,
"strId" : "efg@company.ptt",
"name" : "efg",
"type" : 50,
"latitude":"37.4346",
"longitude":"127.023",
"locationDate":"2016-07-22 03:22:33"
}
]
}
|
Get User Count
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/users/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | user count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Example :
Create User
1) request
Method | POST |
URL | {ServerURL}/openapi/1/users?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
strId | string | user's ProPTT2 id. Don't have domain name | mandatory |
hashedPassword | string | Lowercase(Base16(Sha512(user's password))) | mandatory |
name | number | user's name | mandatory |
type | number | user's type. 50: Normal, 70: Channel Leader, 80: Dispatcher, 90:Manager (Required Server 3.0.1 ~) | mandatory |
email | string | user's email | |
description | string | user's description | |
level | number | user's level id. default is 1. The id must be in adminWeb.(Required Server 5.1.0 ~) | |
phoneNumber | string | user's phoneNumber(Required Server 5.1.0 ~) | |
Example :
{
"strId": "abc@company.ptt",
"hashedPassword": "c321ba878",
"name": "abc",
"type": 50,
"email": "abc@company.com",
"description":"team leader"
}
|
2) response
field name | type | description | option |
id | number | created user's ID | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
403 | Forbidden. Invalid Access |
406 | Not Acceptable. Would be license limitation |
412 | Precondition failed. Would be already same ID |
500 | Internal error |
Example :
Get User
1) request
Method | GET |
URL | {ServerURL}/openapi/1/users/{uid}?id={userid}&hid={hostid}&skey={sessionkey} |
uid | user's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
id | number | user's ID | mandatory |
strId | string | user's ProPTT2 id(email) | mandatory |
name | string | user's name | mandatory |
type | number | user's type. 20: ProGate, 21: SIP device, 50: Normal, 70: Channel Leader, 80: Dispatcher, 90:Manager (Required Server 3.0.1 ~) | mandatory |
email | string | user's email | |
description | string | user's description | |
latitude | string | user's last latitude. (Required Server 1.2.x ~) | |
longitude | string | user's last longitude. (Required Server 1.2.x ~) | |
locationDate | string | last update date of user's location. (Required Server 1.2.x ~) | |
level | number | user's level id(Required Server 5.1.0 ~) | |
phoneNumber | string | user's phoneNumber(Required Server 5.1.0 ~) | |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"id":123
"strId": "abc@company.ptt",
"name": "abc",
"type": 50,
"email": "abc@company.com",
"description":"team leader",
"latitude":"37.4898",
"longitude":"127.033",
"locationDate":"2016-07-21 05:42:35"
}
|
Update User
1) request
Method | PUT |
URL | {ServerURL}/openapi/1/users/{uid}?id={userid}&hid={hostid}&skey={sessionkey} |
uid | user's ID to be updated |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
name | string | user's name | |
type | number | user's type. 50: Normal, 70: Channel Leader, 80: Dispatcher, 90:Manager (Required Server 3.0.1 ~) | |
hashedPassword | string | Lowercase(Base16(Sha512(user's password))) | |
email | string | user's email | |
description | string | user's description | |
authToken | string | user's authToken for second authentication (Required Server 2.2.8 ~) | |
level | number | user's level id. The id must be in adminWeb.(Required Server 5.1.0 ~) | |
phoneNumber | string | user's phoneNumber(Required Server 5.1.0 ~) | |
latitude | double | user's last latitude. (Required Server 5.1.0 ~) | |
longitude | double | user's last longitude. (Required Server 5.1.0 ~) | |
Example :
{
"email": "abc@proptt2.com",
"name": "abc",
"description":"team leader"
}
|
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Delete User
1) request
Method | DELETE |
URL | {ServerURL}/openapi/1/users/{uid}?id={userid}&hid={hostid}&skey={sessionkey} |
uid | user's ID to be deleted |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Send a message to User
1) request
Method | POST |
Required | Server 1.2.x ~, SDK 1.2.x ~, Client 1.3.x ~ |
URL | {ServerURL}/openapi/1/users/{uid}/sendMessage?id={userid}&hid={hostid}&skey={sessionkey} |
uid | user's ID to be received |
id | company owner's id(email). It is a sender. |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body :
field name | type | description | option |
messageId | number | message's id | mandatory |
messageContent | string | message to be sent. messageContent=Base64(message) | |
Example :
{
"messageId": 1,
"messageContent":"SGVsbG8="
}
|
2) response
field name | type | description | option |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found-Receiver |
500 | Internal error |
Example :
Get Channel List of User
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/users/{uid}/channels?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start record index. 0 based. Server 9.0.x~ required. Optional |
pageSize | size to get. Server 9.0.x~ required. Optional |
Body : Nothing
2) response
field name | type | description | option |
channels | | | channel list | |
id | number | channel's ID | mandatory |
no | string | channel's No | mandatory |
name | string | channel's name | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"channels":[
{
"id" : 1,
"no" : "34",
"name" : "abc"
},{
"id" : 2,
"no" : "23",
"name" : "efg"
}
]
}
|
Get Channel Count of User
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/users/{id}/channels/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | channel count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Get Upload List of User
1) request
Method | GET |
Required | Server 9.2.x ~ |
URL | {ServerURL}/openapi/1/users/{uid}/uploads?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start upload index. 0 based. |
pageSize | size to get. |
Body : Nothing
2) response
field name | type | description | option |
uploads | | | upload list | |
ownerId | number | owner id | mandatory |
seq | number | record's ID | mandatory |
type | number | 10: Normal | mandatory |
status | number | 10: Normal | mandatory |
channelId | number | PTT channel ID | mandatory |
ownerName | string | owner's name | mandatory |
playTime | number | play time. second | mandatory |
fileType | number | file type, 10: Video, Audio, 30:Picture | mandatory |
location | number | channel no | mandatory |
startDate | string | started date for all records | mandatory |
createDate | string | created date | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"uploads":[
{
"ownerId" : 1,
"seq" : 1,
"type" : 10,
"status" : 10,
"channelId" : 1,
"ownerName" : "owner name",
"playTime" : 60,
"fileType" : 10,
"location" : "132.827|37.3424",
"startDate" : "2017-11-02 04:29:02",
"createDate" : "2017-11-02 04:29:02"
},{
"ownerId" : 1,
"seq" : 2,
"type" : 10,
"status" : 10,
"ownerName" : "owner name",
"playTime" : 60,
"fileType" : 10,
"location" : "132.827|37.3424",
"startDate" : "2017-11-02 04:29:02",
"createDate" : "2017-11-02 04:30:02"
}
]
}
|
Get Upload Count of User
1) request
Method | GET |
Required | Server 9.2.x ~ |
URL | {ServerURL}/openapi/1/users/{id}/uploads/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | channel count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Organization
Get Organization List
1) request
Method | GET |
URL | {ServerURL}/openapi/1/organizations?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start record index. 0 based. Server 9.0.x~ required. Optional |
pageSize | size to get. Server 9.0.x~ required. Optional |
Body : Nothing
2) response
field name | type | description | option |
organizations | | | radio list | mandatory |
id | number | organization's ID | mandatory |
parentId | number | organization's parent ID. if parent ID is zero, it is root. | mandatory |
name | string | organization's name | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Example :
{
"organizations":[
{
"id" : 1,
"parentId" : 0,
"name" : "abc"
},{
"id" : 2,
"parentId" : 1,
"name" : "efg"
}
]
}
|
Get Organization Count
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/organizations/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | organization count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Example :
Get Organization
1) request
Method | GET |
URL | {ServerURL}/openapi/1/organizations/{oid}?id={userid}&hid={hostid}&skey={sessionkey} |
oid | organization's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
id | string | organization's id | mandatory |
parentId | string | organization's parentId | mandatory |
name | string | organization's name | mandatory |
description | string | organization's description | |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"id":123,
"parentId" : 0,
"name": "abc",
"description":"office"
}
|
Get Users Of Organization
1) request
Method | GET |
URL | {ServerURL}/openapi/1/organizations/{oid}/users?id={userid}&hid={hostid}&skey={sessionkey} |
oid | organization's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start record index. 0 based. Server 9.0.x~ required. Optional |
pageSize | size to get. Server 9.0.x~ required. Optional |
Body : Nothing
2) response
field name | type | description | option |
users | | | user list | mandatory |
id | number | user's ID | mandatory |
strId | string | user's ProPTT2 ID(email) | mandatory |
name | string | user's name | mandatory |
level | number | user's level id(Required Server 5.1.0 ~) | |
phoneNumber | string | user's phoneNumber(Required Server 5.1.0 ~) | |
email | string | user's email(Required Server 5.1.0 ~) | |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"users":[
{
"id" : 1,
"strId" : "abc@company.ptt",
"name" : "abc"
},{
"id" : 2,
"strId" : "efg@company.ptt",
"name" : "efg"
}
]
}
|
Get User Count of Organization
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/organizations/{id}/users/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | user count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
Record (Server 2.2.8~)
Get Record List
1) request
Method | GET |
URL | {ServerURL}/openapi/1/records?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start record index. 0 based |
pageSize | size to get |
Body : Nothing
2) response
field name | type | description | option |
records | | | record list | mandatory |
id | number | record's ID | mandatory |
type | number | 10: AudioPTT, 20:VideoPTT, 31:VideoShared | mandatory |
status | number | 10: Normal | mandatory |
fileSize | number | file size(KB) | mandatory |
channelId | number | channel id | mandatory |
channelNo | number | channel no | mandatory |
channelName | string | channel's name | mandatory |
ownerId | number | owner id | mandatory |
ownerName | string | owner's name | mandatory |
createDate | string | created date | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
500 | Internal error |
Example :
{
"records":[
{
"id" : 1,
"type" : 10,
"status" : 10,
"fileSize" : 32,
"ownerId" : 1,
"channelId" : 1,
"channelNo" : 1,
"channelName" : "channel name",
"ownerName" : "owner name",
"createDate" : "2017-11-02 04:29:02"
},{
"id" : 2,
"type" : 10,
"status" : 20,
"fileSize" : 40,
"channelId" : 1,
"channelNo" : 1,
"channelName" : "channel name",
"ownerId" : 1,
"ownerName" : "owner name",
"createDate" : "2017-11-02 04:45:02"
}
]
}
|
Get Record Count
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/records/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | record count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Example :
Get Record by VideoChannelId
1) request
Method | GET |
Required | Server 9.0.x ~ |
URL | {ServerURL}/openapi/1/records/byVideoChannelId/{videoChannelId}?id={userid}&hid={hostid}&skey={sessionkey} |
videoChannelId | record's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
id | number | record's ID | mandatory |
type | number | 10: AudioPTT, 20:VideoPTT, 31:VideoShared | mandatory |
status | number | 10: Normal | mandatory |
fileSize | number | file size(KB) | mandatory |
createDate | string | created date | mandatory |
filepath | string | recorded file path | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"id" : 2,
"type" : 10,
"status" : 20,
"fileSize" : 40,
"createDate" : "2017-11-02 04:45:02",
"filepath" : "/proptt2/record/vid/20171104/ptt-userid.vid"
}
|
Get Record
1) request
Method | GET |
URL | {ServerURL}/openapi/1/records/{rid}?id={userid}&hid={hostid}&skey={sessionkey} |
rid | record's ID to get |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
id | number | record's ID | mandatory |
type | number | 10: AudioPTT, 20:VideoPTT, 31:VideoShared | mandatory |
status | number | 10: Normal | mandatory |
fileSize | number | file size(KB) | mandatory |
channelId | number | channel id | mandatory |
channelNo | number | channel no | mandatory |
channelName | string | channel's name | mandatory |
ownerId | number | owner id | mandatory |
ownerName | string | owner's name | mandatory |
createDate | string | created date | mandatory |
filepath | string | recorded file path | mandatory |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
404 | Not Found |
500 | Internal error |
Example :
{
"id" : 2,
"type" : 10,
"status" : 20,
"fileSize" : 40,
"channelId" : 1,
"channelNo" : 1,
"channelName" : "channel name",
"ownerId" : 1,
"ownerName" : "owner name",
"createDate" : "2017-11-02 04:45:02",
"filepath" : "/proptt2/record/ptt/20171104/ptt-userid.ptt"
}
|
Upload (Server 9.2.1~)
Get Upload List
1) request
Method | GET |
URL | {ServerURL}/openapi/1/uploads?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
start | start upload index. 0 based |
pageSize | size to get |
Body : Nothing
2) response
field name | type | description | option |
uploads | | | upload list | mandatory |
ownerId | number | owner id | mandatory |
seq | number | record's ID | mandatory |
type | number | 10: Normal | mandatory |
status | number | 10: Normal | mandatory |
channelId | number | PTT channel ID | mandatory |
ownerName | string | owner's name | mandatory |
playTime | number | play time. second | mandatory |
fileType | number | file type, 10: Video, Audio, 30:Picture | mandatory |
location | number | channel no | mandatory |
startDate | string | started date for all records | mandatory |
createDate | string | created date | mandatory |
code | string | result. "200" is success | mandatory |
message | string | result. "OK" is success | mandatory |
Available error code :
code | description |
400 | Bad Request. Would be paramater invalid |
500 | Internal error |
Example :
{
"uploads":[
{
"ownerId" : 1,
"seq" : 1,
"type" : 10,
"status" : 10,
"channelId" : 1,
"ownerName" : "owner name",
"playTime" : 60,
"fileType" : 10,
"location" : "132.827|37.3424",
"startDate" : "2017-11-02 04:29:02",
"createDate" : "2017-11-02 04:29:02"
},{
"ownerId" : 1,
"seq" : 2,
"type" : 10,
"status" : 10,
"ownerName" : "owner name",
"playTime" : 60,
"fileType" : 10,
"location" : "132.827|37.3424",
"startDate" : "2017-11-02 04:29:02",
"createDate" : "2017-11-02 04:30:02"
}
]
}
|
Get Upload Count
1) request
Method | GET |
Required | Server 9.2.x ~ |
URL | {ServerURL}/openapi/1/Uploads/count?id={userid}&hid={hostid}&skey={sessionkey} |
id | company owner's id(email) |
hid | source host id(1~10) in auth command |
skey | server's sessionkey |
Body : Nothing
2) response
field name | type | description | option |
count | number | record count | mandatory(If success) |
code | string | result. "200" is success | mandatory(Server 9.0.x~) |
message | string | result. "OK" is success | mandatory(Server 9.0.x~) |
Available error code :
code | description |
500 | Internal error |
Example :
Reference
- Base16, Base64 : RFC 3548(https://www.ietf.org/rfc/rfc3548.txt)