Resource Representation

{
    "id": 1,
    "attribute_group_id": 1,
    "assignment_target": "self",
    "assignment_type": "global",
    "assignment_global_type": "MediaItem",
    "attribute_group_code": "media_item_ag1"

}

Supported Formats

json

GET /api/v2/attribute_group_assignments
List attribute group assignments

Supported Formats

json

Errors

Code Description
401 Unauthorized. Include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
403 Forbidden. The request was a valid request, but the server is refusing to respond to it. 403 error semantically means "unauthorized", i.e. the user does not have the necessary permissions for the resource.
404 Not Found. The requested resource could not be found.
422 Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors.
500 Internal Server Error. An unexpected condition was encountered.

Examples

Response:
{
    "page": 1,
    "per_page": 50,
    "total_pages": 1,
    "total_entries": 3,
    "entries": [
      {
        "id": 1,
        "attribute_group_id": 1,
        "assignment_target": "self",
        "assignment_type": "global",
        "assignment_global_type": "MediaItem",
        "attribute_group_code": "media_item_ag1"
      }

    ]
}

Params

Param name Description
per_page
optional

Number of objects in one response. Default is 50

Validations:

  • Must be a number.

page
optional

Page number. Default is 1

Validations:

  • Must be a number.

created_time_from
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

created_time_to
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

updated_time_from
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

updated_time_to
optional

ISO_8601 format 2016-05-30T05:13:26Z

Validations:

  • Must be a String

attribute_group_id
optional

Attribute Group ID

Validations:

  • Must be a String

assignment_type
optional

Assignment Type

Validations:

  • Must be one of: global.

assignment_global_type
optional

Assignment Global Type

Validations:

  • Must be one of: MediaItem.


POST /api/v2/attribute_group_assignments
Create an attribute group assignment

Supported Formats

json

Errors

Code Description
401 Unauthorized. Include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
403 Forbidden. The request was a valid request, but the server is refusing to respond to it. 403 error semantically means "unauthorized", i.e. the user does not have the necessary permissions for the resource.
404 Not Found. The requested resource could not be found.
422 Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors.
500 Internal Server Error. An unexpected condition was encountered.

Examples

request:

  {
    "attribute_group_assignment": {
        "attribute_group_id": 2,
        "assignment_target": "self",
        "assignment_type": "global",
        "assignment_global_type": "MediaItem"
    }
  }

  Sample: Assign attribute group to all categories under specified category set (category set with id 1 in this example)

  {
    "attribute_group_assignment": {
        "attribute_group_id": 2,
        "assignment_target": "children",
        "assignment_type": "specific",
        "assigned_entity_id": 1,
        "assigned_entity_type": "CategorySet"
    }
  }


response:
{
  "id": 1,
  "attribute_group_id": 2,
  "assignment_target": "self",
  "assignment_type": "global",
  "assignment_global_type": "MediaItem",
  "attribute_group_code": "media_item_ag1"
}

Params

Param name Description
attribute_group_assignment
required

Validations:

  • Must be a Hash

attribute_group_assignment[attribute_group_id]
optional , nil allowed

Attribute Group ID

Validations:

  • Must be a Integer

attribute_group_assignment[assigned_entity_id]
optional , nil allowed

ID of Entity to which the attribute group is being assigned. For example; the ID of CategorySet if the attribute group is being assigned to CategorySet

Validations:

  • Must be a Integer

attribute_group_assignment[assigned_entity_type]
optional , nil allowed

Type of entity to which the attribute group is being assigned

Validations:

  • Must be one of: CategorySet.

attribute_group_assignment[assignment_target]
optional , nil allowed

Target entity to which the attribute group is being assigned. For example; if the assignment_target is self and provided entity is CategorySet, the attribute group will be assigned to CategorySet itself and if the assignment_target is children, the attribute group will be assigned to the categories under the provided category set

Validations:

  • Must be one of: self, children.

attribute_group_assignment[assignment_type]
optional , nil allowed

If global, the attribute group will be assigned across all the provided assignment_global_type. If specific, the attribute group will be assigned to specifc entities. For example; assign attribute group to all the categories under specific category set

Validations:

  • Must be one of: global, specific.

attribute_group_assignment[assignment_global_type]
optional , nil allowed

Type of Entity for assigning attribute group to when the assignment_type is global,

Validations:

  • Must be one of: MediaItem.


DELETE /api/v2/attribute_group_assignments/:id
Delete an attribute group assignment

Supported Formats

json

Errors

Code Description
401 Unauthorized. Include a WWW-Authenticate header field containing a challenge applicable to the requested resource.
403 Forbidden. The request was a valid request, but the server is refusing to respond to it. 403 error semantically means "unauthorized", i.e. the user does not have the necessary permissions for the resource.
404 Not Found. The requested resource could not be found.
422 Unprocessable Entity. The request was well-formed but was unable to be followed due to semantic errors.
500 Internal Server Error. An unexpected condition was encountered.

Examples

response:
  {
    "id": 1
  }