[#979] About using the book method

Migrated from Redmine #979 | Author: Can Demir
Status: Feedback | Priority: High, I’m very impatient | Created: 2022-12-02


Hi,

When creating an booking, I use the book method in the Company public service. Can I assign values to Intake forms parameters with the $additional parameter in the Company public service ‘book’ method?

I have defined an Intake form field in Manage->Intake forms, how can I assign values to these parameters while creating an booking?

Which method should we use? Could you share a sample request?

Kindest regards

Dmytro Bondarev wrote:

Hi,
when you get additional fields via getAdditionalFields method you will receive name of field.
In $additional you can just pass data like
{
“[[fieldName]]”: [[value]]
}

Can Demir wrote:

I send a request as follows, but the response only transmits the methods;

Could you send me the Request as below?

Endpoint: https://user-api.simplybook.me
Method: GET

Body:

{
“id”: 3,
“jsonrpc”: “2.0”,
“method”: “getAdditionalFields”,
“params”: [
1
]
}

Can Demir wrote:

Hi Dmitry,

I made a request as you mentioned earlier, but I couldn’t assign a value to the $additional parameters.

Could you share with me the book method sample request in Company Public Service?

I want to assign values to $additional parameters when creating a reservation.

I wish you good work.

Redmine Admin wrote:

hi, you can call it like in example below
$client->book(40, 1, 1, 2, “2019-09-08”, “13:00”, null, null, 0, array(‘e28064f09a75d91c503f81a0cda3f71e’=>‘field 1 data’, ‘fa23c732e6a0b3caf9aa29b7909b1a44’=>‘field 2 data’));

you need to pass idhash of the additional field, not its name

Can Demir wrote:

thank you for informing me