NIM

resources

Every child of crud_objects must contain a resources child property. In turn, this object contains one custom property per REST resource. Each resource has a name and a value. Values can contain nested resources, thus permitting a tree structure if the external system requires it. Thus, each value must be one of the following:

type specifier

End node of the resource tree. A text value that describes the type of the resource, with optional prefix and postfix specifiers. For example: _:string*

child object

Child resource that is a single object. Can be nested to any depth.

child table

Child resource that is a array of similar objects. Can only exist at the first level, directly under the resources property.

Example JSON taken from the Google connector, showing several type specifiers, a child object (name) and a child table (emails):

"resources": {
	"id": "string*",
	"primaryEmail": "string*",
	"name": {
		"fullName": "string*",
		"familyName": "string*",
		"givenName": "string*"
	},
	"emails": [
		{
			"address": "string*",
			"type": "string*",
			"customType": "string*",
			"primary": "boolean*"
		}
	]
}
type specifier

Each type specifier in the resource tree consists of three parts:

  • _: prefix (optional)

  • type (required)

  • * postfix (optional)

For example: _:string*

_: prefix

Use the _: prefix to differentiate multiple resources that share the same name.

For example, in the JSON below, the addresses resource has multiple child resources with city and street names. The _: prefix prevents collisions and other unpredictable behavior.

In the NIM Studio (e.g., in Data tables and Mappings), the resource's name is displayed as the concatenation of all names leading to the end node, separated by underscores.

  • addresses_mailing_city

  • addresses_mailing_street

  • addresses_physical_city

  • addresses_physical_street

"resources":{
	"id": "number*",
	"local_id": "string*",
	"student_username": "string*",
	"state_province_id": "number*",
	"addresses":{
		"mailing":{
			"city":"_:string",
			"street":"_:string"
		},
		"physical":{
			"city":"_:string",
			"street":"_:string"
		}
	},
type

The type specifies the data type of the resource value. Currently not used.

* postfix

The * postfix makes a resource a default resource. A default resource is automatically marked for Collection when a system is first added in the NIM Studio.