...
Code Block |
---|
HTTP/1.1 200 OK Content-Type: application/json Date: Wed, 29 Aug 2012 04:16:18 GMT ETag: 1 Server: Apache-Coyote/1.1 Content-Length: 401 Connection: keep-alive { "createdOn":"2012-08-29T03:34:00.967Z", "id":"syn1058078", "parentId":"syn4489", "modifiedOn":"2012-08-29T04:16:18.234Z", "createdBy":"John Hill", "accessControlList":"/repo/v1/entity/syn1058078/acl", "etag":"1", "modifiedBy":"John Hill", "name":"Example Project", "annotations":"/repo/v1/entity/syn1058078/annotations", "entityType":"org.sagebionetworks.repo.model.Project", "uri":"/repo/v1/entity/syn1058078" } |
...
Creating Hierarchy
Hierarchy is created in Synapse by setting the "parentId" field of an entity. In this example we are going to create a new folder entity as a child to our project:
Request
Code Block |
---|
curl -i -k -H sessionToken:YourSessionToken -H Accept:application/json -H Content-Type:application/json -d '{"entityType": "org.sagebionetworks.repo.model.Folder", "parentId":"syn1058078", "name":"Sample Folder"}' https://repo-prod.sagebase.org/repo/v1/entity |
Response
Code Block |
---|
HTTP/1.1 201 Created
Content-Type: application/json
Date: Thu, 13 Sep 2012 00:46:10 GMT
ETag: b6c9ab19-c5ed-43ef-9fa2-ae72a8d63bab
Location: /repo/v1/entity/syn1144716
Server: Apache-Coyote/1.1
Content-Length: 436
Connection: keep-alive
{
"createdOn":"2012-09-13T00:46:11.700Z",
"id":"syn1144716",
"parentId":"syn1058078",
"modifiedOn":"2012-09-13T00:46:11.700Z",
"createdBy":"John Hill",
"accessControlList":"/repo/v1/entity/syn1144716/acl",
"etag":"b6c9ab19-c5ed-43ef-9fa2-ae72a8d63bab",
"modifiedBy":"John Hill",
"name":"Sample Folder",
"annotations":"/repo/v1/entity/syn1144716/annotations",
"entityType":"org.sagebionetworks.repo.model.Folder",
"uri":"/repo/v1/entity/syn1144716"
} |
Add Annotations to an Entity
Get the annotations
First get the current annotations for your newly created dataset.
...