_new

Create an Appointment.

Parameters

Only two of these parameters are required: customer_id and meeting_time.

attendees

A stringed JSON object containing two objects:

  • emails: an array of email addresses. if the email addresses are of existing users, they should be preceded by the User ID and a colon ':'

  • email: the email text to send to the attendees.

contract_id

If this Appointment is part of a Contract, include the Contract ID.

contract_name

If this Appointment is part of a Contract but the Contract ID is not known, include the name. If a Contract with this name does not exist, it will be created.

customer_id

The Customer or Asset's ID.

customer_type

'0' for a Customer, '1' for an Asset.

department_id

If this Appointment is for a specific Department, include the ID.

due_date

What date should this Appointment be completed by at the latest.

form_id

The ID of the Form which contains this Appointment's questions.

form_type

'0' for normal Form. '1' for asset rental sign-out, '2' for asset rental sign-in.

job_ref

Textual job reference.

meeting_time

When this Appointment is for. ISO 8601 should be used for all date formats.

user_id

The User this Appointment is assigned to, or 0 if not yet assigned.

priority

Priority of the Appointment. Default is 3.

form_num

Optional form number, so you can say for example that this is the 3rd "inspection form" or the 5th "work sheet", etc.

form_values

Stringified JSON object for pre-filling form questions. each question's text is a key in the object.

notes

Optional text describing notes for this appointment.

recurrence

Optional stringified JSON object describing the recurrence of this appointment.

meta

Optional stringified JSON object. This is usually created by the system itself.

Example

FM_api('Appointment_new',
	  [
	  'attendees'=>'{"emails":["3928:test3@test3.test3","4657:kae@verens.com"],"email":"test"}',
	  'contract_id'=>'1',
	  'customer_id'=>'100831',
	  'customer_type'=>'0',
	  'department_id'=>'0',
	  'due_date'=>'2015-11-02',
	  'form_id'=>'29',
	  'form_type'=>'0',
	  'job_ref'=>'test create/complete 358',
	  'meeting_time'=>'2015-11-02 16:18',
	  'user_id'=>'3928',
	  'priority'=>'3',
	  'form_num'=>'',
	  'form_values'=>'',
	  'notes'=>'',
	  'recurrence'=>'{"active":0}',
	  'meta'=>'{"test":1}'
	  ]
);

Result

{"ok":1,"id":"4657"}

Last updated