[#657] Booking API

Migrated from Redmine #657 | Author: 刚 宋
Status: New | Priority: High, I’m very impatient | Created: 2021-03-03


I am checking SBM API with method “book”

var additional=client.getAdditionalFields(‘14’);
var object = client.book (‘14’,‘14’,‘138’,‘2021-03-03’,‘18:10:00’,‘2021-03-03’,‘19:10:00’,0,additional);

return:
[-32070] Identity Type: - Value is required and can’t be empty

Could you please help me on this. Thanks you.

Redmine Admin wrote:

please provide RAW HTTP request

刚 宋 wrote:

var client = new JSONRpcClient({

   'url': 'https://user-api.simplybook.asia/admin',
   'headers': {
               'X-Company-Login': companyLogin,
               'X-User-Token': token
           },
   'onerror': function (error) {
       alert(error);
       return 'error';
   },

});
var additional=client.getAdditionalFields(14);

var object = client.book (14,14,138,‘2021-03-04’,‘17:00:00’,‘2021-03-04’,‘18:00:00’,0,additional);

How to transfer the intake form using JS

Dmytro Bondarev wrote:

You should pass it as object:

additional = {
‘your_field_hash’: ‘you_field_value’
};

刚 宋 wrote:

var client = new JSONRpcClient({

   'url': 'https://user-api.simplybook.asia/admin',
   'headers': {
               'X-Company-Login': 'weebo',
               'X-User-Token': '692a4f0f39145ec659961287b5cebca762c3e6263469d5ef0179a67c91a4d372'
           },
   'onerror': function (error) {
       alert(error);
       return 'error';
   },

});
var additional= {‘Identity Type:’: true};
var object = client.book (14,14,138,‘2021-03-04’,‘18:00:00’,‘2021-03-04’,‘19:00:00’,0,additional);

return
{“error”:{“code”:-32070,“message”:“Identity Type: - Value is required and can’t be empty”,“data”:},“id”:“1”,“jsonrpc”:“2.0”}