Users

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

/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

Reponse 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

upload_file

Required file. Supported file types: ‘doc’, ‘docx’, ‘gif’, ‘jpg’, ‘jpeg’, ‘md’, ‘mov’,’mp3’, ‘odt’, ‘odp’, ‘ods’, ‘pdf’, ‘png’, ‘ppt’, ‘pptx’, ‘rst’, ‘tif’, ‘tiff’, ‘txt’, ‘xls’, ‘xls’, ‘wav’ Maximum file size: 50MB

type

optional - type of journal to store; default user_file

subtype

optional - subtype of journal to store; default user_file

title

optional - title of the file

comment

optional - comment to go with the file

/api/v1/$FLOCK/user/{uid}/files/

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 file for a user

type

optional - filter by type of journal

subtype

optional - 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-***"
            },
            {
                "creator": "SheepApp",
                "date": "2020-07-01T10:02:43.894000",
                "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 of 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 of 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"
}