Sunshine Custom Object App Requirements

Sunshine Custom Objects let you define new object types in Zendesk, then create and persist objects based on those types. Relationships can be defined and managed between these and other custom objects, or with native Zendesk objects like tickets and users.

To create a Sunshine custom object app requirement, define a custom object type in your requirements.json file. This has the same structure and options as a Sunshine API object type, but omits the data key. You can define up to 50 custom objects per app.

Example
"custom_objects": {
  "custom_object_types": [
    {
      "key": "product",
      "schema": {
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for a product"
          },
          "name": {
            "type": "string",
            "description": "The name of the product"
          }
        },
        "required": ["id", "name"]
      }
    }
  ]
}

Relationships

A relationship between custom objects can be specified with a custom object relationship type. This has the same structure and options as a Sunshine API relationship type, but omits the data key.

Example
"custom_objects": {
  "custom_object_relationship_types": [
    {
      "key": "manufacturer",
      "source": "product",
      "target": "manufacturer"
    }
  ],
  "custom_object_types": [
    {
      "key": "product",
      "schema": {
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for a product"
          },
          "name": {
            "type": "string",
            "description": "The name of the product"
          },
        },
        "required": ["id", "name"]
      }
    },
    {
      "key": "manufacturer",
      "schema": {
        "properties": {
          "id": {
            "type": "string",
            "description": "The unique identifier for a manufacturer"
          },
          "name": {
            "type": "string",
            "description": "The name of the manufacturer"
          },
        },
        "required": ["id", "name"]
      }
    }
  ]
}

Relationship types can also be specified with native Zendesk object types including tickets and users. See Relationship Types in the Sunshine API documentation for more information.