system
March 3, 2021, 10:48am
1
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.
system
March 4, 2021, 8:42am
2
Redmine Admin wrote:
please provide RAW HTTP request
system
March 4, 2021, 8:54am
3
刚 宋 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
system
March 4, 2021, 8:59am
4
Dmytro Bondarev wrote:
You should pass it as object:
additional = {
‘your_field_hash’: ‘you_field_value’
};
system
March 4, 2021, 9:23am
5
刚 宋 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”}