system
December 30, 2020, 4:23pm
1
Migrated from Redmine #632 | Author: Ed Horrocks
Status: Feedback | Priority: High, I’m very impatient | Created: 2020-12-30
Hi
Can the API be called from client side technologies eg. javascript / jQuery or
do you have to use server side stuff like PHP or Java
system
December 30, 2020, 4:34pm
2
Dmytro Bondarev wrote:
You can call it from client side, but you have to keep credentials in secure place.
system
December 30, 2020, 4:35pm
3
Ed Horrocks wrote:
Hi Dmitry
Do you have a client side code snippet for this to get me started please
Ed
system
December 30, 2020, 4:38pm
4
Dmytro Bondarev wrote:
In case you are using JSON RPC, then please look here API documentation | SimplyBook.me Online Scheduling
And we do not have such explorer for REST API at this moment.
system
December 30, 2020, 4:45pm
5
Ed Horrocks wrote:
Is that using .net ?
I’m using javascript / jQuery
Do I have an alternative. PHP on the server side3
system
December 30, 2020, 4:45pm
6
Redmine Admin wrote:
you can use whatever you like and need
system
December 30, 2020, 4:57pm
7
Ed Horrocks wrote:
testing: function () {
var dat = {},j;
dat.login = "edmund.horrocks@bthft.nhs.uk";
dat.password = "testpassword";
dat.company = "bradfordroyalinfirmary";
//Content-Type: application/json
$.ajax({
dataType: "application/json",
type: "POST",
data: dat,
url: "https://user-api-v2.simplybook.me/admin/auth",
success: function (data) {
window.console.data;
},
error: function (jqXHR, textStatus, errorThrown) {
window.console(textStatus);
}
});
},
=============
This fairly simple jQuery function fails returning a code:400 ‘company’ invalid type etc
I’ve tried vanilla javascript as well and that fails
system
December 30, 2020, 5:35pm
8
Dmytro Bondarev wrote:
We usually do not provide support about programming languages and frameworks, but here you have to set:
dataType: “json”,
data: JSON.stringify(dat),
and probably you have to use different server address.