...
Code Block |
---|
curl -i -k -H Accept:application/json -H Content-Type:application/json -d '{ "email": "me@myEmail.com", "password": "thisIsAFakePassword" }' https://auth-prod.sagebase.org/auth/v1/session |
Response
Expand | ||
---|---|---|
| ||
|
Create/Update/Delete Examples
...
Code Block |
---|
curl -i -k -H sessionToken:YourSessionToken -H Accept:application/json -H Content-Type:application/json -d '{"entityType": "org.sagebionetworks.repo.model.Project"}' https://repo-prod.sagebase.org/repo/v1/entity |
Response
Expand | ||
---|---|---|
| ||
|
In the above example, we created an entity with only the 'entityType' but the returned entity had many more fields set. In the next section we will cover the basic fields of an entity.
...
Code Block |
---|
curl -i -k -H sessionToken:YourSessionToken -H ETag:0 -H Accept:application/json -H Content-Type:application/json -X PUT -d '{ "createdOn":"2012-08-29T03:34:00.967Z", "id":"syn1058078", "parentId":"syn4489", "modifiedOn":"2012-08-29T03:34:00.967Z", "createdBy":"John Hill", "accessControlList":"/repo/v1/entity/syn1058078/acl", "etag":"0", "modifiedBy":"John Hill", "name":"Example Project", "annotations":"/repo/v1/entity/syn1058078/annotations", "entityType":"org.sagebionetworks.repo.model.Project", "uri":"/repo/v1/entity/syn1058078" }' https://repo-prod.sagebase.org/repo/v1/entity/syn1058078 |
Response
Expand | ||
---|---|---|
| ||
|
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:
...