Using UUIDs Instead of Domain or Data Record Pathnames
While not as human-friendly, UUIDs can be used to be more lookup-friendly to the web service. Since YOUnite uses UUIDs for lookups in the underlying store, UUIDs can be considered if there are performance concerns (for example, for domains that are frequently referenced) but it has not been quantified how much performance is actually gained by using them.
The UUIDs for a domain/s properties is returned with the following:
Getting the UUIDs of a Domain's Properties
GET /domains/<domain-name>/properties
{ "properties": [{ . "uuid": "bab4b589-be75-4e7c-93c8-c89e037d307d", . . "propertyName": "capital", . . }, { . "uuid": "7388d88b-d2b8-4585-a08f-ab373c1b0043", . . "propertyName": "capital.city", . . }, { . . . }] }
Getting the UUIDs of a Data Record's Properties
To get the UUIDs for a data record's properties use:
GET /drs/<domain-name>/<display-value>?refs=true
For example, to post a student
data record with a reference to a country
data record using an UUID:
GET /drs/country/CAN?refs=true
{ "name": { "value": "Canada", "_self": "9a472159-fc7c-4730-b8af-5007b26f890c" }, "immigrationAddress": { "Street": { "value": "220 4th Avenue, SE, Room 210", "_self": "df879f43-cd93-4f5e-b77a-4ac64e0b5ba4" }, "city": {... }, "province-state": {}, "postal-code": {} }, . . . }
Then, POST the student
data record with the appropriate UUID for the cross-references
POST /drs/students
{ "firstname": "Jane", "lastname": "D'oe", . . "homeCountry": "9a472159-fc7c-4730-b8af-5007b26f890c", "immigrationAddress": "08c257b-74ac-406e-b56f-9cbbab87a57f" }