Users
General user information
Section titled “General user information”This method will provide user data for most common use-cases.
/api/v1/$FLOCK/user/{uid}/
http https://api.sheepcrm.com/api/v1/$FLOCK/user/{uid}/ "Authorization: Bearer $APP_API_KEY"Person data
Section titled “Person data”/api/v1/$FLOCK/user/{uid}/person/
http https://api.sheepcrm.com/api/v1/$FLOCK/user/{uid}/person/ "Authorization: Bearer $APP_API_KEY"Avatar / Photo of the user
Section titled “Avatar / Photo of the user”Response will be a redirect to the hosted photo.
/api/v1/$FLOCK/user/{uid}/photo/
http https://api.sheepcrm.com/api/v1/$FLOCK/user/{uid}/photo/ "Authorization: Bearer $APP_API_KEY"
HTTP/1.1 302 Found...Storing user files
Section titled “Storing user files”/api/v1/$FLOCK/user/{uid}/files/
| Parameter | Required | Description |
|---|---|---|
| upload_file | Yes | Supported file types: doc, docx, gif, jpg, jpeg, md, mov, mp3, odt, odp, ods, pdf, png, ppt, pptx, rst, tif, tiff, txt, xls, xlsx, wav. Maximum file size: 50MB |
| type | No | Type of journal to store; default user_file |
| subtype | No | Subtype of journal to store; default user_file |
| title | No | Title of the file |
| comment | No | Comment to go with the file |
http -f POST https://api.sheepcrm.com/api/v1/$FLOCK/user/{uid}/files/ "upload_file@test.pdf" title="My File upload" comment="only a test" "Authorization: Bearer $APP_API_TOKEN"
HTTP/1.0 200 OK{ "file": "https://s3-eu-west-1.amazonaws.com/sheepcrm/sheep-app/journal/****/files/test.pdf", "journal": { "body": null, "context": { "display_value": "James W Webster", "ref": "/sheep-app/person/******/" }, "creator": "SheepApp", "creator_reference": null, "date": "2020-07-01T09:02:22.067000", "entity": { "display_value": "{uid}", "ref": "/sheep-app/useraccount/***/" }, "entry_subtype": "user_file", "entry_type": "user_file", "files": [ null, "https://s3-eu-west-1.amazonaws.com/sheepcrm/sheep-app/journal/****/files/test.pdf" ], "legacy_uid": null, "link": null, "star": false, "tags": [ "attachment" ], "text_body": "only a test", "title": "My File upload", "trigger_resource_ref": null }, "journal_ref": "/sheep-app/journal/****/"}Getting a list of files for a user
Section titled “Getting a list of files for a user”| Parameter | Required | Description |
|---|---|---|
| type | No | Filter by type of journal |
| subtype | No | Filter by subtype of journal |
http GET https://api.sheepcrm.com/api/v1/$FLOCK/user/{uid}/files/ "Authorization: Bearer $APP_API_TOKEN"
{ "files": [ { "creator": "SheepApp", "date": "2020-07-01T10:38:21.212000", "display_value": "My File upload", "entry_subtype": "user_file", "entry_type": "user_file", "file": "https://s3-eu-west-1.amazonaws.com/sheepcrm/sheep-app/journal/***/files/test.pdf", "files": [ "https://s3-eu-west-1.amazonaws.com/sheepcrm/sheep-app/journal/***/files/test.pdf" ], "status": "updated", "text_body": "only a test", "title": "My File upload", "uid": "sheep-app-journal-***" } ]}Getting a single file for a user
Section titled “Getting a single file for a user”http GET https://api.sheepcrm.com/api/v1/$FLOCK/user/{uid}/files/{file_uid}/ "Authorization: Bearer $APP_API_TOKEN"
{ "creator": "SheepApp", "date": "2020-06-30T19:00:53.935000", "display_value": "File uploaded: test.pdf", "entry_subtype": "user_file", "entry_type": "user_file", "file": "https://s3-eu-west-1.amazonaws.com/sheepcrm/sheep-app/journal/*****/files/test.pdf", "files": [ "https://s3-eu-west-1.amazonaws.com/sheepcrm/sheep-app/journal/*****/files/test.pdf" ], "status": "updated", "text_body": "User uploaded file", "title": "File uploaded: test.pdf", "uid": "sheep-app-journal-*****"}Delete a single file for a user
Section titled “Delete a single file for a user”http DELETE https://api.sheepcrm.com/api/v1/$FLOCK/user/{uid}/files/{file_uid}/ "Authorization: Bearer $APP_API_TOKEN"
{ "https://s3-eu-west-1.amazonaws.com/sheepcrm/sheep-app/journal/********/files/pdfshift-test.pdf": "deleted", "journal_uri": "deleted"}