(Quick Reference) Service: Upsert an appointment category

Description: This web service is used to insert an appointment category object to the database if it does not already exist, or update it.

URL with external_id:

https://BASE_URL/api/VERSION/appointmentCategories/reference/{id}

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
namethe name of the new appointment categoryStringYes 
isActive BooleanNotrue
color StringNo#FFFFFF, #1BE9D8

The default value of isActive is true
The reference must be unique

Success Output

Success case: response.status=201
{
  	"id": 11,
  	"reference": "team_meeting",
 	"name": "Weekly sales team meeting",
  	"isActive": true,
  	"isDefault": false,
  	"color": "#1BE9D8",
 	"organization": "entity1",
  	"dateCreated": "2016-09-09T08:18:51Z",
  	"lastUpdated": "2016-09-09T08:18:51Z"
}

Failure Output

Failure case:response.status = 400
{
    "error": "missing_param",
    "error_description": "name parameter is missing"
}

{
	"error": "invalid_param_type",
	"error_description": "An invalid value was specified for parameter: isActive (must be a boolean: true or false)"
}

{
	"error": "not_unique",
	"error_description": "reference already used"
}

{
	"error": "invalid_color_format",
	"error_description": "The format used to indicate the color is incorrect"
}

{
     "error": "save_failed",
     "error_description": "Failed to save instance"
}
Failure case:response.status = 500
{
     "error": "server_error",
     "error_description": "Oops! Something went wrong..."
}