diff --git a/Json-service.md b/Json-service.md index af292b6..bde93b3 100644 --- a/Json-service.md +++ b/Json-service.md @@ -21,3 +21,20 @@ From the command line: You should receive the same response that the `nc` command provides. + +## Some example requests + +ENTRY: `{"jsonrpc":"2.0","method":"listGroups","id":"5"}` +REPLY: `{"jsonrpc":"2.0","result":[...],"id":"5"}` + +ENTRY: `{"jsonrpc":"2.0","method":"send","params":{"recipient":["+YYY"],"message":"MESSAGE"},"id":4}` +REPLY: `{"jsonrpc":"2.0","result":{"timestamp":999},"id":4}` + +ENTRY: `{"jsonrpc":"2.0","method":"updateGroup","params":{"groupId":"GROUP_ID=","name":"new group name","members":["+ZZZ"],"link":"enabledWithApproval","setPermissionEditDetails":"onlyAdmins"},"id":"someId"}` +REPLY: `{"jsonrpc":"2.0","result":{"timestamp":9999},"id":"someId"}` + +ENTRY: `{"jsonrpc":"2.0","method":"sendSyncRequest","id":9}` +REPLY: `{"jsonrpc":"2.0","result":{},"id":9}` + +ENTRY: `{"jsonrpc":"2.0"}` +REPLY: `{"jsonrpc":"2.0","error":{"code":-32600,"message":"method field must be set","data":null},"id":null}`