[#36] how to add service provider throw api

Migrated from Redmine #36 | Author: alok soni
Status: Resolved | Priority: High, I’m very impatient | Created: 2017-09-01


first code

addServiceProvider($data)
{
“name” : “newtagg1 - 4”,
“description” : “Description - 1”,
“phone” : “1234567890”,
“email” : “test@test.com”,
“qty” : “2”,
“is_visible” : 1,
“is_active” : 1,
“position” : 2,
“position_in_location” : null,
“locations” : [ 3 ],
“services” : [ 1, 2 ]
}

second code =

$data{
“name” : “newtagg1 - 4”,
“description” : “Description - 1”,
“phone” : “1234567890”,
“email” : “test@test.com”,
“qty” : “2”,
“is_visible” : 1,
“is_active” : 1,
“position” : 2,
“position_in_location” : null,
“locations” : [ 3 ],
“services” : [ 1, 2 ]
}

addServiceProvider($data)

which one code is right if both are wrong please suggest me right code

please help me.

Dmytro Bondarev wrote:

What the language do you use?

alok soni wrote:

javascript

(Short original content)

Dmytro Bondarev wrote:

then
var data = {
“name” : “newtagg1 - 4”,
“description” : “Description - 1”,
“phone” : “1234567890”,
“email” : “test@test.com”,
“qty” : “2”,
“is_visible” : 1,
“is_active” : 1,
“position” : 2,
“position_in_location” : null,
“locations” : [ 3 ],
“services” : [ 1, 2 ]
};

client.addServiceProvider(data);

alok soni wrote:

my complete code

now i am getting

Uncaught TypeError: client.addServiceProvider is not a function

Dmytro Bondarev wrote:

Please use admin service instead of public.

alok soni wrote:

How to use please help

Dmytro Bondarev wrote:

[[API documentation | SimplyBook.me Online Scheduling]]
Please read

User/Admin API (Company administration service) authorization

alok soni wrote:

hello sir my new code this

now i am getting error= Uncaught SyntaxError: Unexpected string

on

$loginClient = new JsonRpcClient(‘http://user-api.simplybook.me’ . ‘/login/’);

Please help :frowning:

Vitaliy Kordiak wrote:

Check your code, maybe you have “Unexpected string”?

alok soni wrote:

Where sir my file is here

Vitaliy Kordiak wrote:

This problem arise not in api, but in the validity of your code. Unfortunately, we can not help with the validity, as it is not in our competence. If you have problems with our api, we will be happy to assist you

alok soni wrote:

ok sir i will be back after completing this error