1005: Create child

Creates a new entity/account as a child of another entity in the Rubiq database, with fields specified in a contract between the calling application and the Rubiq API. The parent-child relationship between the entities must be previously established in Rubiq Cloud.


Endpoint ID:1005
Method:POST
URL:

/entity/id/{entity-id}/child/{contract-id}

/entity/ext-key/{ext-key}/{ext-type}/child/{contract-id}



entity-id

Rubiq entity ID that uniquely identifies the new child's parent entity


ext-key

External key that uniquely identifies the new child's parent entity


ext-typeType of external key

contract-id

Identifies the type of child to create and the set of contract fields passed in the request body

Request body:

 JSON data with properties corresponding to the fields in the specified contract

Example 1 - Contract specifies first name, last name and gender:
{
	"firstName": "John",
	"lastName": "Doe",
	"gender": "Male"
}

Response body:

JSON data with key(s) and data for the newly created child entity. The result will always hold the Rubiq entity ID, and if the app making the request is configured to use a specific external key, this key is also included in the response.

Example 1 – App setting specifies no specific key:
{
	"id": 123456
	"firstName": "John",
	"lastName": "Doe",
	"gender": "Male"
}
Example 2 – App setting specifies external key type:
{
	"id": 123456,
	"extKeyType": 12,
	"extKey": "key",
	"firstName": "John",
	"lastName": "Doe",
	"gender": "Male"
}
Status codes:

201

Child was created with success

303Child already exists

400Request is valid but data validation failed