The atPlatform : The 'batch' verb

The atPlatform : The 'batch' verb

Introduction

The batch verb in the atPlatform allows multiple commands to be sent in a single call to the secondary server. Developers of apps can leverage the batch feature to send multiple commands, thereby reducing the number of network calls from the device to the secondary server.

1. Usage

1.1 Sample Request

[{"id":1,"command":"update:public:phone@alice +1 111 1111”},
{"id":2,"command":"update:@alice:phone@alice +1 222 2222”},
{"id":3,"command":"delete:public:phone@alice”}]

1.2 Sample Response

data:[{"id":1,"response":{"data":10}},
     {"id":2,"response":{"data":11}},
     {"id":3,"response":{"data":12}}]

2.1 Invalid command in batch

[{"id":1,"command":"update:public:phone@alice +1 111 1111”},
{"id":2,"command":"update:@alice:phone@alice”}]

2.2 Sample error response

data:[[{"id":1,"response":{"data":13}}, {"id":2,"response":{"error_code":"AT0003","error_message":"Invalid syntax"}}]

Refer to the BatchVerbHandler to learn more about this verb.

Coming Soon

The batch verb has not yet been exposed in our SDK . We plan to do that soon.