it passed the first login, but now it gives me another error when I try to access https://user-api.simplybook.me/admin, the response throws back:
{“message”:“Attribute provided with invalid value: Header:null”,“name”:“Exception”,“fileName”:“Code”,“lineNumber”:95,“stack”:“\tat Code:95 (bookData)\n”}
The code:
try{
var eventId=line[headers.indexOf("eventId (behandling - i tal)")];
var unitId=line[headers.indexOf("unitId (massørens ID - i tal)")]
var clientId;
var clientName=line[headers.indexOf("client")];
var clientEmail=line[headers.indexOf("email")];
var clienPhone=line[headers.indexOf("phone")];
var startDate=line[headers.indexOf("date (in Y-m-d format)")];
var startTime=line[headers.indexOf("time (in H:i:s format)")];
var endDate=line[headers.indexOf("endDate (in Y-m-d format)")];
var endTime=line[headers.indexOf("endTime (in H:i:s format)")];
var clientTimeOffset=0;
var add={"promo_code":line[headers.indexOf("promocode")],
"promocode":line[headers.indexOf("promocode")],
"location_id":line[headers.indexOf("location")],
"0db3e7523ba2ad3424742eb1f56826c4":line[headers.indexOf("additional_field_1 (address)")],
"a594df96d2602518ee7644da0a82f203":line[headers.indexOf("additional_field_3 (note)")],
"838af9e8ecd97e7b75fa1cb07cd422f8":line[headers.indexOf("additional_field_7 (pleje)")],
"841a80c5c2b3cc2295652f2575c72172":line[headers.indexOf("additional_field_6 (rabatkode)")],
"9828213cddf686368da0709155b89e50":line[headers.indexOf("additional_field_8")],
}
var comment=line[headers.indexOf("comment")];
// Get Client Id or create new client
options.payload=JSON.stringify({"jsonrpc":"2.0","method":"addClient","params":[{
name: clientName,
phone: clienPhone,
email: clientEmail,
}],"id":99})
var response=UrlFetchApp.fetch('https://user-api.simplybook.me/admin', options);
if (response.getResponseCode()==200){