Create a Customization

Last edit:  Sep 03, 2018

Contributors:  pavelloz

To create a customization send a POST request to /api/user/customizations

HTTP request

POST /api/user/customizations

Parameters

Parameter Type Description Required Notes
form_configuration_name String Name of the form configuration Required underscored
form CustomizationForm CustomizationForm parameters that corresponds with FormConfiguration configuration Required
parent_resource_id ID (Int or String) Id or name of definced CustomizationType Required name should be underscored

Customization Parameters

Parameter Type Description Required Notes
custom_addresses Hash[String=>CustomAddressForm] Custom addresses for this resource Optional
custom_attachments Hash[String=>CustomAttachmentForm] Custom attachments for this resource, such as pdf, doc Optional
custom_images Hash[String=>CustomImageForm] Custom images for this resource Optional
custom_model_type_name String Name (in snake case) of the associated CustomModelType Required
customizable_id Integer Numeric identifier for the object to which the customization is attached Optional
customizable_type String Type of the object to which the customization is attached. Valid values: User UserProfile Transactable Offer Order Instance Reservation Relationship Optional used in conjunction with customizable_id
customizations Hash[String=>CustomizationForm] Customizations for this resource Optional
id Integer Numeric identifier of the associated object Optional
properties Hash[String=>Any] Custom properties Optional
user_id Integer Numeric identifier for the object to which the customization is attached Optional

Example request

"authorization: Token token=[YOUR API TOKEN]"
"accept: application/json"
"content-type: application/json"

{
  "form_configuration_name": "reference_rest_api_create_customization",
  "parent_resource_id": "links",
  "form": {
    "properties": {
      "url": "google.com"
    }
  }
}
Element Type Description Required?
form_configuration_name String Name of the defined FormConfiguration Required
form CustomizationForm Attributes for user, should match configuration defined in corresponding FormConfiguration Required

Example response

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "id": 1,
  "errors": {}
}

Element Type Description
id Integer Object identifier
errors Object Validation errors

Error and Status Codes

Code Message Meaning
201 Created Resource was created
401 Unathorized Invalid Authentication
406 Not Acceptable Wrong parameters passed
422 Unprocessable Entity Wrong values, not matched validations