OPTIONS to Understand Resources

The Buzz API supports the OPTIONS method which describes a given resource.

📘

Migration Notes from 0.5 API

  • The OPTIONS method is new to the Buzz 2.0 API. In the 0.5 API a similar functionality was offered by the fields extra.

Basic OPTIONS Syntax

curl -X OPTIONS "[host]/rest/v2/[resource]" -b cookies.txt

The response includes helpful information about the resource as shown in the example below:

{
	"name": "Sample resource",
	"description": "",
	"renders": ["application/json", "text/html"],
	"parses": ["application/json", "application/x-www-form-urlencoded", "multipart/form-data"],
	"actions": {
		"PUT": {
			"id": {
				"type": "integer",
				"required": false,
				"read_only": true,
				"label": "ID"
			},
			},
			"create_date": {
				"type": "datetime",
				"required": false,
				"read_only": true,
				"label": "Create date"
			},
			"update_date": {
				"type": "datetime",
				"required": false,
				"read_only": true,
				"label": "Update date"
			},
			"active": {
				"type": "boolean",
				"required": false,
				"read_only": false,
				"label": "Active"
			},
			"alternative_id": {
				"type": "string",
				"required": false,
				"read_only": false,
				"label": "Alternative id",
				"max_length": 200
			},
			"notes": {
				"type": "string",
				"required": false,
				"read_only": false,
				"label": "Notes",
				"max_length": 255
			},
			"name": {
				"type": "string",
				"required": false,
				"read_only": false,
				"label": "Name",
				"max_length": 191
			},
			"account_id": {
				"type": "field",
				"required": false,
				"read_only": false,
				"label": "Account id"
			}
		}
	}
}