Sheep Teams =========== Teams aka Groups, Regions, Applications. Our Teams system was originally built for volunteer applications to teams but has been re-used in many different ways. At the heart of the system is the concept of a *Team* which people can join and leave. :Team: team / group / region / area of expertise SheepCRM resource: `group` :team member: member of the team, applicant SheepCRM resource: `group_member` Application Status ------------------ :accepted: accepted / member / finished / joined :follower: pre-application / interested / follower :started: application started but not yet completed :applied: application submitted (but not accepted) :ready-for-references: references can now be requested :checking: e.g. out for reference checking :references-received: references are back and ready to checked :rejected: rejected by team leaders :waiting: accepted - waiting to join when space permits :cancelled: application cancelled by user :no-show: applicant failed to a :flagged: application has an issue/problem needs human judgement Team Home --------- Teams root showing all flocks that a user can access .. code-block:: http http https://api.sheepcrm.com/api/v1/teams/ Authorization:"Bearer $API_KEY" HTTP/1.1 200 OK { "bearer_token": "***", "first_name": "Support", "flocks": [ "example", "example-association", "example-family", ], "last_login": "2020-02-21T14:18:55", "last_name": "User" } Team Data --------- The large config data packet available for building a client application. .. code-block:: http http https://api.sheepcrm.com/api/v1/teams/$FLOCK/ Authorization:"Bearer $API_KEY" HTTP/1.1 200 OK { "bearer_token": "***", "config": { "address_lines": [ "1 Pretend Street", "Pretendsville", "Utah" ], "availableOptions": [ "giving", "consent", "membership", "events", "venues", "payments" ], "base_for_above": { "flockNamePublic": "Sheep Example", "flockNamePublicShort": "Example", "include_form": true, "logo": "/images/flocks/logo.png", "name_in_logo": false, "signupline": "Become a member", "tagline": "Testing System - For Internal Use Only", "website": "http://www.getsheep.co.uk/" }, "consent_list": [ { "channels": [ "email" ], "cid": "c000", "context": "What’s On Newsletter", "purpose": "Live Programme Newsletter" }, { "channels": [ "email", "phone", "post" ], "cid": "c001", "context": "Bothering phonecalls and letters", "purpose": "To bother you" } ], "email": "fake@example.com", "events": true, "flockNamePublic": "My Community Trust", "flockNamePublicShort": "MCT", "how_to_contact_us_intro": "You can't contact us, because we're not a real organisation, but if we were you could use some details like these.", "how_we_collect": [ "you send us an email", "you sign up as a member", "you make a donation", "you volunteer", "you sign up to a mailing list online" ], "how_we_collect_intro": "We collect personal information directly from you when:", "include_form": true, "logo": "...", "membership": { "allowMultiple": true, "cardstreamDev": { "countryCode": 826, "currencyCode": 826, "merchantId": "***", "preSharedKey": "***" }, "confirmIntroText": "Please double check the details and then click confirm", "enabled": true, "hideFilteredByDefault": true, "payLater": { "linkText": "Request an invoice" }, "paymentOptions": [ "payLater", "stripe", "cardstreamDev" ], "stepIntroText": [ "Select the membership plan that best suits you. ", "Please enter your details so we can create an account for you. We take your privacy very seriously and won't share this information with any third parties without your express consent.", "Please review the information below and check for any errors before continuing. If you find anything that isn't correct, please go back and make your changes.", "Please choose how you would like to pay." ], "steps": [ "Configure membership", "Enter your details", "Review & Confirm", "Make Payment" ] }, "name_in_logo": false, "other_questions_contact": "If you do not want us to use your data in this way, wish to stop receiving communications from us or have any other questions please email us at [myprivacy@sheepcrm.com](mailto:myprivacy@sheepcrm.com?subject=I have a question about the personal information you hold for me)", "palette": { "featureColor": "#f65161", "headerFont": "'Raleway', sans-serif", "hoverColor": "#902b35", "mainColor": "#f65161", "mainFont": "'Open Sans', sans-serif" }, "phone": "01234 567 890", "privacy_intro": "We take privacy very seriously and want to ensure your personal data is cared for correctly and in line with the new General Data Protection Regulation (GDPR). The following page gives some information about how we care for your personal data followed by a short form which you can fill in to tell us how you would like us to communicate with you.", "signupline": "Become a member", "stripeKey": "***", "tagline": "", "teams": { "enabled": false }, "venue_hire": { "amenities_introduction": "Each work space comes with everything you need to get your project off the ground.", "important_information_list": [ { "content": "You don’t need to bring anything, however bringing proof of this reservation will speed up the checking process. If you bring your own electrical tools to use on site then they must comply with health & safety legislation or if require mains supply will need to have been PAT tested. If necessary we can undertake PAT testing on site.", "heading": "What to bring" }, { "content": "On your booked day you have 1 hour to claim your booked bench otherwise you will risk losing your booking, i.e if you have a morning slot you have until 10.30am, otherwise your bench will be given away.", "heading": "Claiming your bench" }, { "content": "If you can’t make it for any reason, please note that you need to let us know before 5.30pm the day before, otherwise you will be charged as we are unable to book anyone in alternatively. For Monday bookings please let us know by the Saturday before as we are closed on Sundays.", "heading": "Cancellation Policy" } ] }, "website": "https://www.sheepcrm.com/", "what_we_collect": [ "contact details and personal information to enable us to plan, organise and manage our annual festival and year round events and keep you up to date with news and other information ", "financial information relating to payments for tickets and merchandise and donations to enable such payments and donations (including Gift Aid applications) to be processed. " ], "what_we_collect_intro": "We collect the following information:", "why_we_collect": [ "To build up a picture of our customer/supporter profile;", "To keep you up to date with news of our events, activities and other information;", "To process a payment that you have made for tickets or merchandise;", "To process a donation that you have made (including Gift Aid information); ", "To manage our employees and volunteers; ", "To maintain our own accounts and records;", "To process a grant;", "To process an application for a role." ], "why_we_collect_intro": "We use your personal data for the following purposes:" }, "first_name": "Support", "flocks": [ "example", "example-association", "example-family", ], "is_staff": true, "last_login": "2020-02-21T14:18:55", "last_name": "User" } List all active teams for a flock --------------------------------- .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/teams/ Authorization:"Bearer $API_KEY" { "grand_total": 11, "results": [ { "_id": null, "bucket": "...", "created": "2019-07-01T15:29:06.413000", "data": { "accepted": 1, "active": true, "category": "category", "description": null, "entry_requirements": null, "invite_code": null, "invite_only": false, "joining_policy": null, "leader": [ null ], "links": {}, "location": null, "location_address_string": null, "location_country": null, "location_postal_code": null, "max": null, "min": null, "name": "name", "reapply_to_group": null, "remuneration": null, "renuneration": null, "skills_required": null, "tags": [ null ], "total_applicants": 1, "uid": "...-group-5d1a26c2461a181aadaa9b15", "uri": "/.../group/5d1a26c2461a181aadaa9b15/", "what_you_will_do": null, "working_pattern": null }, "display_value": "name", "last_updated": "2019-07-01T15:29:06.472000", "resource": "group", "state": "updated", "uri": "/.../group/5d1a26c2461a181aadaa9b15/" }, ... ], "total": 11 } List of active teams for a given leader ---------------------------------------- :{leader-slugified-uri}: the person uri of the leader. slugify the uri (/example/person/1234/ => example-person-1234) .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/{leader-slugified-uri} Authorization:"Bearer $API_KEY" { "grand_total": 11, "results": [ { "_id": null, "bucket": "...", "created": "2019-07-01T15:29:06.413000", "data": { "accepted": 1, "active": true, "category": "category", "description": null, "entry_requirements": null, "invite_code": null, "invite_only": false, "joining_policy": null, "leader": [ null ], "links": {}, "location": null, "location_address_string": null, "location_country": null, "location_postal_code": null, "max": null, "min": null, "name": "name", "reapply_to_group": null, "remuneration": null, "renuneration": null, "skills_required": null, "tags": [ null ], "total_applicants": 1, "uid": "...-group-5d1a26c2461a181aadaa9b15", "uri": "/.../group/5d1a26c2461a181aadaa9b15/", "what_you_will_do": null, "working_pattern": null }, "display_value": "name", "last_updated": "2019-07-01T15:29:06.472000", "resource": "group", "state": "updated", "uri": "/.../group/5d1a26c2461a181aadaa9b15/" }, ... ], "total": 11 } Single team detail ------------------ Full team data including a list of members with basic profile data. Team UID is a slugified version of the group URI e.g. ``example-group-5c055088d406945a79dab6d8`` .. code-block:: http http https://api.sheepcrm.com/api/v1/teams/$FLOCK/{team-uid}/ Authorization:"Bearer $API_KEY" HTTP/1.1 200 OK { "active": true, "category": "primary", "config": { ... }, "description": "This group is an example, which anyone should be able to join.\n\nIt has headers\n==========\n\nIt **must** correctly display markdown text including:\n\n* lists\n* _emphasis_\n* headers\n* ~magic~ paragraphs\n", "entry_requirements": "There are no specific requirements for this team", "invite_code": null, "invite_only": false, "joining_policy": null, "leader": [ null ], "leaders": [], "location": null, "location_address_string": null, "location_country": null, "location_postal_code": null, "max": null, "members": [ { "email": "britt@home.com", "extra": null, "first_name": "Britt", "group": "/example/group/5c055088d406945a79dab6d8/", "last_name": "Abernathy", "membership_status": "cancelled", "mobile": null, "person": "/example/person/54aaf7ad3078f80d90d8ca11/", "person_name": "Britt Abernathy", "photo-avatar": "https://s3-eu-west-1.amazonaws.com/sheepcrm/example/person/54aaf7ad3078f80d90d8ca11/photo/avatar--woman-profile.jpeg", "role": "Group Admin", "sortable_name": "abernathy britt", "status": "applied", "tags": [ null ], "telephone": "01235012289", "uid": [ "example-group_member-5d8dffc10b915a588aa79f57" ], "uri": "/example/group_member/5d8dffc10b915a588aa79f57/" }, ... ], "min": null, "name": "Example Group 1", "processing_operation": null, "reapply_to_group": null, "remuneration": null, "renuneration": null, "skills_required": "It would be helpful if applicants were able to survive in a nitrogen-rich atmosphere", "tags": [ null ], "total_volunteer_days": 0, "what_you_will_do": null, "working_pattern": null } List of tasks for a given team ------------------------------ :{team-slugified-uri}: the team uri. slugify the uri (/example/group/1234/ => example-group-1234) Open tasks: .. code-block:: http https://api.sheepcrm.com/api/v2/teams/$FLOCK/team/{team-slugified-uri}/tasks Authorization:"Bearer $API_KEY" All tasks (open and closed): .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/team/{team-slugified-uri}/tasks/all Authorization:"Bearer $API_KEY" Completed (done) tasks: .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/team/{team-slugified-uri}/tasks/done Authorization:"Bearer $API_KEY" My open tasks (logged in user): .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/team/{team-slugified-uri}/tasks/mine Authorization:"Bearer $API_KEY" All my tasks (logged in user): .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/team/{team-slugified-uri}/tasks/mine/all Authorization:"Bearer $API_KEY" All my completed tasks (logged in user): .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/team/{team-slugified-uri}/tasks/mine/done Authorization:"Bearer $API_KEY" Open Tasks (full example): .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/team/{team-slugified-uri}/tasks Authorization:"Bearer $API_KEY" HTTP/1.1 200 OK { "tasks": [ { "context": "/example/person/5e71f9ffb4d5a266087d3d9e/", "entity": "/sheepcrm/user/****/", "entry_subtype": null, "entry_type": "reminder", "last_updated": "2020-03-25T10:54:37.749000", "star": false, "state": "updated", "tags": [ null ], "title": "Sample task", "uri": "/example/journal/5e7b386db4d5a24cdbc97262/" } ] } Single member detail v2 ----------------------- *Not backward compatible* Personal details of team member (filtered fields allowed by whitelist) and group status .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/member/{member_uid}/ Authorization:"Bearer $API_KEY" HTTP/1.1 200 OK { "address_lines": [ "..." ], "bio": null, "comms_permission": [ null ], "connections": [ null ], "country": "UK", "date_of_birth": null, "deceased": null, "display_value": null, "email": [ "example@sheepcrm.com" ], "email_opt_out": null, "emergency_contact_details": null, "emergency_contact_details_2": null, "external_photo_url": null, "extra": null, "facebook_username": null, "first_name": "Joe", "formatted_name": "Joe Jeffries", "group": "{group uri}", "initial": null, "instagram_username": null, "interests": [ "***", ], "iso_country": "GB", "job_title": null, "known_as": "jj the third", "language": null, "last_name": "Jeffries", "linkedin_public_profile": null, "locality": "***", "member_since": null, "name_suffix": null, "person": "{person uri}", "photo": null, "postal_code": "***", "region": "Devon", "role": null, "salutation": "Sir", "sortable_name": "jeffries joe", "status": "accepted", "team_member_tags": [ null ], "telephone": [ "***" ], "time_zone": null, "title": null, "twitter_username": null, "uri": "{team member uri}", "website": null } Updating a team member. Fields which are permitted to update will be returned in response. Invalid fields will be silently ignored. .. code-block:: http http PUT https://api.sheepcrm.com/api/v2/teams/$FLOCK/member/{member_uid}/ Authorization:"Bearer $API_KEY" first_name=Susan invalid_field=foo HTTP/1.1 200 OK { "first_name": "Susan" } Users for teams --------------- A list of users that are team leaders, staff and admin users. .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/users/ Authorization:"Bearer $API_KEY" HTTP/1.1 200 OK { "results": [ { "display_value": "James Webster", "uri": "/sheepcrm/user/****", "user": "/sheepcrm/user/****/" }, { "display_value": "Support User", "uri": "/sheepcrm/user/****", "user": "/sheepcrm/user/****/" }, { "display_value": "Will Jeffries", "uri": "/sheepcrm/user/****", "user": "/sheepcrm/user/****/" }, { "display_value": "Joe Jeffries", "uri": "/sheepcrm/user/****", "user": "/sheepcrm/user/****/" }, } } Users for a specific team ------------------------- A list of users that are team leaders for a given team and all staff and admin users. .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/team/{team-slugified-uri}/users/ Authorization:"Bearer $API_KEY" HTTP/1.1 200 OK { "results": [ { "display_value": "Will Jeffries", "uri": "/sheepcrm/user/****", "user": "/sheepcrm/user/****/" }, { "display_value": "Joe Jeffries", "uri": "/sheepcrm/user/****", "user": "/sheepcrm/user/****/" }, } } Members across all teams ------------------------- Method for extracting all team members regardless of team :category: optional - filter by category :expansions: optional control param for more/less data - `application_questions` - include application questions and answers - `consolidated_questions` - use in conjunction with `application_questions` to consolidate questions and answers across multiple applications - `profile` - add profile data - `-team_memberships` - remove team_membership data Accepted Team Members .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/members/ "Authorization: Bearer $API_KEY" All Team Members: .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/members/all/ "Authorization: Bearer $API_KEY" Team Members by status: .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/members/{status}/ "Authorization: Bearer $API_KEY" Team Members by status and category filter: .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/members/{status}/ category==Hobbies "Authorization: Bearer $API_KEY" Example Output in full .. code-block:: http http https://api.sheepcrm.com/api/v2/teams/$FLOCK/members/ "Authorization: Bearer $API_KEY" HTTP/1.0 200 OK { "grand_total": 1, "results": [ { "person_uri": "/example/person/5e7dd4e680859e2e284749c6/", "team_memberships": [ { "category": "Area of Expertise", "role": null, "short_description": null, "status": "accepted", "tags": [ null ], "team": "/example/group/5ed69c4780859e6662841a3a/", "team_member_uri": "/example/group_member/5ed69c6080859e6662841a4c/", "team_name": "Restoration" }, ], "team_names": [ "Restoration" ], "teams": [ "/example/group/5ed69c4780859e6662841a3a/", ] } ], "total": 1 } http https://api.sheepcrm.com/api/v2/teams/$FLOCK/members/all/ "Authorization: Bearer $API_KEY" HTTP/1.0 200 OK { "grand_total": 1, "results": [ { "person_uri": "/example/person/5e7dd4e680859e2e284749c6/", "team_memberships": [ { "category": "Hobbies", "role": null, "short_description": null, "status": "accepted", "tags": [ null ], "team": "/example/group/5ed69c4780859e6662841a3a/", "team_member_uri": "/example/group_member/5ed69c6080859e6662841a4c/", "team_name": "Restoration" }, { "category": "Area of Expertise", "role": null, "short_description": null, "status": "started", "tags": [ null ], "team": "/example/group/5ee360c480859e34fcc6ff1f/", "team_member_uri": "/example/group_member/5ee360e380859e34fcc6ff31/", "team_name": "Security" } ], "team_names": [ "Security", "Restoration" ], "teams": [ "/example/group/5ed69c4780859e6662841a3a/", "/example/group/5ee360c480859e34fcc6ff1f/" ] } ], "total": 1 } .. still to do /api/v1/teams/(?P[\w\-]+)/download/ 'sheepapi.teams.download' /api/v1/teams/(?P[\w\-]+)/download_full/ 'sheepapi.teams.download_full' /api/v1/teams/(?P[\w\-]+)/(?P[\w\-]+)/download/ 'sheepapi.teams.single_download' /api/v1/teams/(?P[\w\-]+)/(?P[\w\-]+)/download_full/ 'sheepapi.teams.single_download_full' /api/v1/teams/(?P[\w\-]+)/(?P[\w\-]+)/email/ 'sheepapi.teams.single_email'