Crew APIs v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Overview
The Crew APIs provide powerful capabilities to customize, automate, and integrate Crew. Important information and workflow can be pushed into Crew, and the APIs can also be used to gain visibility into activities happening within Crew. The below provides some common examples of ways the Crew APIs can be leveraged. In addition, Crew already provides off-the-shelf integrations with these leading software providers.
Getting Started
To get started with the Crew APIs or for specific questions, please contact developers@crewapp.com.
Common Use Cases
Sync Scheduling Data with Crew
Employees and teams benefit from having a single place to get all of the important information they need for a successful day at work. Integrating the team schedule with Crew means putting the schedule in every team member's pocket, in the same place they access all other critical work information. Crew APIs support two-way syncing of the scheduling, pushing scheduling data into Crew and syncing any changes to the schedule that happen within Crew (e.g., shift swaps and filling open shifts).
Push Important Information into Crew
Getting the right information to your frontline teams can be a challenge. There's important information that lives in myriad systems. Crew APIs enable pushing the right information to the right team members at the right time. With the flexible Cards APIs, deliver beautifully formatted content that team members will engage with and can take action on from their mobile device.
Automate Tasks and Digitize Workflows
Trying to reduce paper-based processes, copying information from one place to another, and other duplicative and wasted effort? Leverage Crew APIs to automate things like assigning tasks, collecting data, and notifying teams.
Sync Employee Roster with System of Record
Crew syncs with any system of record to ensure that the employee roster and hierarchy in Crew mirrors the source of truth. Use Crew APIs to automatically onboard and remove employees from Crew.
Base URLs:
Email: Support
Authentication
oAuth2 authentication. Applications that integrate with Crew to take action on behalf of a Crew account must request permissions from the Crew account holder to perform those actions. OAuth is the mechanism applications use to request permissions from account holders. For information about OAuth specification, see OAuth 2.0.
The following process is used to obtain permission from the Crew account holder in order to obtain Access Tokens to perform tasks on their behalf.
Appplication Provides Authorization Link: Applications configure and serve a link with the following parameters:
+scope: A commma-separated list of the desired OAuth permissions
+clientId: Application's clientId
+target: Should always be ENTERPRISE_ACCOUNT
+redirectUri: The specific URI Crew should redirect back to
+state: (optional) Used by applicatin developer to prevent CSRF attacks
Account Holder Completes Permission Form: After the Crew account holder clicks the authorization link, they are prompted with a permissions form hosted by Crew.
Crew Redirects with Authorization Code: When the account holder clicks Allow on the permission form, Crew sends an OAuth authorization code (as a URL parameter) to the redirect specified URL.
Application Exchanges for Access Token: The client application uses the (short-lived) authorization code to request an OAuth access token from the /connect/oauth/access-token endpoint.- Flow: authorizationCode
- Authorization URL = https://crewapp.com/oauth/
- Token URL = https://api.crewapp.com/connect/oauth/access-tokens
Scope | Scope Description |
---|---|
CALENDAR_VIEW | Grants read access to view calendar information |
CALENDAR_EDIT | Grants write access to edit calendar information |
ENTERPRISE_VIEW | Grants read access to view information about an enterprise |
ORGANIZATION_MEMBER_VIEW | Grants read access to view information about an organization |
MESSAGE_CONVERSATION | Grants permissions to send a message to a targeted conversation |
MESSAGE_EVERYONE | Grants permissions to send a message to an everyone group, reaching all members of an organization |
MIDDLEWARE_PUBLISH | Grants permission to publish location, user, and calendar items via the Crew middleware |
OAuth
Authenticate with our system
To generate an Access Token
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'https://api.crewapp.com/connect/access-tokens',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.crewapp.com/connect/access-tokens', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/access-tokens");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const inputBody = '{
"code": "string",
"accessToken": null,
"clientSecret": "string",
"clientId": "string",
"expirationTime": 0
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.crewapp.com/connect/access-tokens',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.crewapp.com/connect/access-tokens", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /connect/access-tokens
All subsequent API calls to Crew require a valid Access Token. This call allows you to exchange a valid Authorization Code or renew a valid OAuth Token.
Body parameter
{
"code": "string",
"accessToken": null,
"clientSecret": "string",
"clientId": "string",
"expirationTime": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | Access | true | none |
Example responses
200 Response
[
{
"accessToken": "string",
"expiresAt": 0,
"acessTokenId": "string",
"scope": [
null
],
"target": "string",
"targetId": "string"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | Inline |
405 | Method Not Allowed | Invalid input | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» accessToken | string | false | none | Access token used to allow access to Crew's APIs |
» expiresAt | integer | false | none | Epoch seconds of expiration date |
» acessTokenId | string | false | none | Unique identifier |
» scope | [any] | false | none | List of scopes the acess token has been granted |
» target | string | false | none | The type of target -- e.g, ENTERPRISE_ACCOUNT -- the token is associated with |
» targetId | string | false | none | The Crew ID of the target |
Users
Retrieve User Information
To fetch user information
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/users/{userId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/users/{userId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/users/{userId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/users/{userId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/users/{userId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/users/{userId}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
userId | path | integer(int64) | true | Id of user |
Example responses
200 Response
[
{
"id": "string",
"profile": {
"fullName": "string",
"avatarPublicId": "string"
}
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | Inline |
405 | Method Not Allowed | Invalid input | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [UserResp] | false | none | none |
» id | string | false | none | Unique identifier for user |
» profile | UserProfile | false | none | none |
»» fullName | string | false | none | Users full name |
»» avatarPublicId | string | false | none | Unique identifier for users profile picture |
Organizations
Get Information about an Organization
To retrieve information about an organization
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/organizations/{organizationId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/organizations/{organizationId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/organizations/{organizationId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/organizations/{organizationId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/organizations/{organizationId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/organizations/{organizationId}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationId | path | integer(int64) | true | Id of organization |
Example responses
200 Response
[
{
"organizationId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
}
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
405 | Method Not Allowed | Invalid input | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [OrganizationResp] | false | none | none |
» organizationId | OrganizationId | false | none | none |
»» id | string | false | none | Unique identifier for organization |
»» updatedAt | integer | false | none | Epoch milliseconds that the organization was last updated |
»» entityType | string | false | none | ORGANIZATION |
To fetch organization members
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/organizations/{organizationId}/members',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/organizations/{organizationId}/members', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/organizations/{organizationId}/members");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/organizations/{organizationId}/members',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/organizations/{organizationId}/members", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/organizations/{organizationId}/members
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationId | path | integer(int64) | true | Id of organization |
Example responses
200 Response
[
{
"userId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
},
"organizationId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
},
"createdAt": 0,
"updatedAt": 0,
"permissions": {
"admin": true
},
"profile": {
"title": "string"
}
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
405 | Method Not Allowed | Invalid input | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [OrganizationMembershipResp] | false | none | none |
» userId | UserId | false | none | none |
»» id | string | false | none | Unique identifier for user |
»» updatedAt | integer | false | none | Epoch milliseconds that the user was last updated |
»» entityType | string | false | none | USER |
» organizationId | OrganizationId | false | none | none |
»» id | string | false | none | Unique identifier for organization |
»» updatedAt | integer | false | none | Epoch milliseconds that the organization was last updated |
»» entityType | string | false | none | ORGANIZATION |
» createdAt | integer | false | none | Epoch milliseconds that the membership was created at |
» updatedAt | integer | false | none | Epoch milliseconds that the membership was last updated at |
» permissions | Permissions | false | none | none |
»» admin | boolean | false | none | whether user is an organization admin or not |
» profile | Profile | false | none | none |
»» title | string | false | none | Employees title |
To fetch groups in an organization
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/organizations/{organizationId}/groups',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/organizations/{organizationId}/groups', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/organizations/{organizationId}/groups");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/organizations/{organizationId}/groups',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/organizations/{organizationId}/groups", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/organizations/{organizationId}/groups
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationId | path | integer(int64) | true | Id of organization |
Example responses
200 Response
[
{
"conversationId": "string",
"name": "string",
"numMembers": 0,
"createdAt": 0
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
405 | Method Not Allowed | Invalid input | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [GroupResp] | false | none | none |
» conversationId | string | false | none | ID of the conversation associated with the group |
» name | string | false | none | Name of the group |
» numMembers | integer | false | none | Number of members in the group |
» createdAt | integer | false | none | Epoch milliseconds that the group was created at |
To fetch conversations in an organization
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/organizations/{organizationId}/conversations',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/organizations/{organizationId}/conversations', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/organizations/{organizationId}/conversations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/organizations/{organizationId}/conversations',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/organizations/{organizationId}/conversations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/organizations/{organizationId}/conversations
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationId | path | integer(int64) | true | Id of organization |
Example responses
200 Response
[
{
"id": "string",
"name": "string",
"members": 0
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
405 | Method Not Allowed | Invalid input | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [ConversationResp] | false | none | none |
» id | string | false | none | ID of the conversation |
» name | string | false | none | Name of the conversation |
» members | integer | false | none | Number of organization members in the conversation |
Enterprises
Get Information About on an Enterprise
To retrieve information about an enterprise
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/enterprises/{enterpriseId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/enterprises/{enterpriseId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/enterprises/{enterpriseId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/enterprises/{enterpriseId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/enterprises/{enterpriseId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/enterprises/{enterpriseId}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
enterpriseId | path | integer(int64) | true | Id of enterprise |
Example responses
200 Response
[
{
"organizationId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
}
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
405 | Method Not Allowed | Invalid input | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [EnterpriseResp] | false | none | none |
» organizationId | EnterpriseId | false | none | none |
»» id | string | false | none | Unique identifier for enterprise |
»» updatedAt | integer | false | none | Epoch milliseconds that the enterprise was last updated |
»» entityType | string | false | none | ENTERPRISE |
To get a list of the organizations within an enterprise
Code samples
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/enterprises/{enterpriseId}/organizations',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/enterprises/{enterpriseId}/organizations', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/enterprises/{enterpriseId}/organizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/enterprises/{enterpriseId}/organizations',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/enterprises/{enterpriseId}/organizations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/enterprises/{enterpriseId}/organizations
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
enterpriseId | path | integer(int64) | true | Id of enterprise |
Example responses
200 Response
[
{
"organizationId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
},
"updatedAt": null
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | successful operation | Inline |
405 | Method Not Allowed | Invalid input | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
anonymous | [EnterpriseOrgsResp] | false | none | none |
» organizationId | OrganizationId | false | none | none |
»» id | string | false | none | Unique identifier for organization |
»» updatedAt | integer | false | none | Epoch milliseconds that the organization was last updated |
»» entityType | string | false | none | ORGANIZATION |
» updatedAt | any | false | none | Epoch milliseconds that the organization membership was last updated |
Calendar Items
Create & Update Shifts and Other Calendar Items
Creates calendar item with the specified parameters
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.crewapp.com/connect/calendar-items',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.crewapp.com/connect/calendar-items', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/calendar-items");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const inputBody = '{
"organizationId": "string",
"start": 0,
"end": 0,
"timeZoneName": "string",
"type": "TIME_OFF",
"notes": "string",
"muteAssignmentNotifications": true,
"members": {
"type": "USER",
"userId": "string"
},
"name": "string"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/calendar-items',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.crewapp.com/connect/calendar-items", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /connect/calendar-items
Body parameter
{
"organizationId": "string",
"start": 0,
"end": 0,
"timeZoneName": "string",
"type": "TIME_OFF",
"notes": "string",
"muteAssignmentNotifications": true,
"members": {
"type": "USER",
"userId": "string"
},
"name": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CalendarItems | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
To fetch calendar items for given time range
Code samples
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/organizations/{organizationId}/calendar-items',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/organizations/{organizationId}/calendar-items', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/organizations/{organizationId}/calendar-items");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/organizations/{organizationId}/calendar-items',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/organizations/{organizationId}/calendar-items", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/organizations/{organizationId}/calendar-items
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationId | path | integer(int64) | true | Id of organization |
startsAtOrAfter | query | string | false | Epoch time in milliseconds that calendar item starts after |
startsAtOrBefore | query | string | false | Epoch time in milliseconds that calendar item starts before |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
To fetch calendar item by passed ID
Code samples
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/connect/calendar-items/{calendarItemId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/connect/calendar-items/{calendarItemId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/calendar-items/{calendarItemId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/connect/calendar-items/{calendarItemId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /connect/calendar-items/{calendarItemId}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
calendarItemId | path | integer | true | Id of calendar item |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
Updates calendar item with passed parameters
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.crewapp.com/connect/calendar-items/{calendarItemId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/calendar-items/{calendarItemId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const inputBody = '{
"notes": "string",
"start": "string",
"end": "string",
"status": "string",
"muteAssignmentNotifications": true,
"name": "string"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.crewapp.com/connect/calendar-items/{calendarItemId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /connect/calendar-items/{calendarItemId}
Any explicit JSON null values or empty strings will be interpreted as an unset
Body parameter
{
"notes": "string",
"start": "string",
"end": "string",
"status": "string",
"muteAssignmentNotifications": true,
"name": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
calendarItemId | path | integer(int64) | true | Id of calendar item |
body | body | PatchCalendarItems | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
Mark the calendar item with the given id deleted
Code samples
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.crewapp.com/connect/calendar-items/{calendarItemId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.crewapp.com/connect/calendar-items/{calendarItemId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/calendar-items/{calendarItemId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.crewapp.com/connect/calendar-items/{calendarItemId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /connect/calendar-items/{calendarItemId}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
calendarItemId | path | integer(int64) | true | Id of calendar item |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
Calendar Item Members
Assign/Remove Users to Existing Calendar Items
To add new assignees
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const inputBody = '{
"newCalendarItemStatus": "OPEN",
"shouldReplaceMemberStatuses": true,
"members": {
"type": "INVITE",
"userId": "string",
"groupId": "string",
"fullName": "string",
"countryCode": "string",
"phone": "string",
"initialStatus": "ACCEPTED"
}
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /connect/calendar-items/{calendarItemId}/members
Body parameter
{
"newCalendarItemStatus": "OPEN",
"shouldReplaceMemberStatuses": true,
"members": {
"type": "INVITE",
"userId": "string",
"groupId": "string",
"fullName": "string",
"countryCode": "string",
"phone": "string",
"initialStatus": "ACCEPTED"
}
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
calendarItemId | path | integer(int64) | true | Id of calendar item |
body | body | CalendarItemsMembers | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
For a user to request a shift if you aren’t part of it already
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const inputBody = '{
"status": "ADDITION_REQUESTED"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /connect/calendar-items/{calendarItemId}/members/{userId}
Body parameter
{
"status": "ADDITION_REQUESTED"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
calendarItemId | path | integer(int64) | true | Id of calendar item |
userId | path | integer(int64) | true | Id of user |
body | body | AdditionRequested | true | order placed for purchasing the pet |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
To approve a cover
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const inputBody = '{
"status": "ACCEPTED"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}',
{
method: 'PATCH',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /connect/calendar-items/{calendarItemId}/members/{userId}
Body parameter
{
"status": "ACCEPTED"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
calendarItemId | path | integer(int64) | true | Id of calendar item |
userId | path | integer(int64) | true | Id of user |
body | body | Status | true | order placed for purchasing the pet |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
To remove a user from a shift
Code samples
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.crewapp.com/connect/calendar-items/{calendarItemId}/members/{userId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /connect/calendar-items/{calendarItemId}/members/{userId}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
calendarItemId | path | integer(int64) | true | Id of calendar item |
userId | path | integer(int64) | true | Id of the user |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
Cards
Generate Formatted HTML 'Cards'
To create a new card
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.crewapp.com/connect/cards',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.crewapp.com/connect/cards', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/cards");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const inputBody = '{
"templateId": "string",
"content": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/cards',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.crewapp.com/connect/cards", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /connect/cards
Body parameter
{
"templateId": "string",
"content": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CardInput | true | none |
Example responses
200 Response
{
"id": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | CardResp |
405 | Method Not Allowed | Invalid input | None |
Messages
Send Messages into Crew
To send messages into Crew
Code samples
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.crewapp.com/connect/messages',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.crewapp.com/connect/messages', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/connect/messages");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const inputBody = '{
"conversationId": "string",
"groupId": "string",
"userId": "string",
"text": "string",
"cardId": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/connect/messages',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.crewapp.com/connect/messages", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /connect/messages
Body parameter
{
"conversationId": "string",
"groupId": "string",
"userId": "string",
"text": "string",
"cardId": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | MessageInput | true | none |
Example responses
200 Response
{
"id": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | MessageResp |
405 | Method Not Allowed | Invalid input | None |
Assets
Retrieve User Assets
to fetch image assets corresponding to users profile picture
Code samples
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.crewapp.com/assets/{publicId}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.crewapp.com/assets/{publicId}', headers = headers)
print(r.json())
URL obj = new URL("https://api.crewapp.com/assets/{publicId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.crewapp.com/assets/{publicId}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.crewapp.com/assets/{publicId}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /assets/{publicId}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
publicId | path | integer(int64) | true | Public Id |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Successful operation | None |
405 | Method Not Allowed | Invalid input | None |
Schemas
Access
{
"code": "string",
"accessToken": null,
"clientSecret": "string",
"clientId": "string",
"expirationTime": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
code | string | false | none | An Authorization Code that can be exchanged for an Access Token as long as the code is still valid |
accessToken | any | false | none | An Access Token that can be exchanged for a new Access Token as long as the exisitng token is still valid |
clientSecret | string | false | none | Application secret provided by Crew |
clientId | string | true | none | Application Client Id |
expirationTime | integer | false | none | Epoch time in seconds that token is desired to expire at. If not passed the token will default to being good for 30 days. Tokens cannot have an expiration more than 90 days in the future |
AdditionRequested
{
"status": "ADDITION_REQUESTED"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
status | string | false | none | ADDITION_REQUESTED |
Status
{
"status": "ACCEPTED"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
status | string | false | none | ACCEPTED, DECLINED |
Enumerated Values
Property | Value |
---|---|
status | ACCEPTED |
status | DECLINED |
PatchCalendarItems
{
"notes": "string",
"start": "string",
"end": "string",
"status": "string",
"muteAssignmentNotifications": true,
"name": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
notes | string | false | none | Text description for the calendar item |
start | string | false | none | Time in millis since epoch for start of shift |
end | string | false | none | Time in millis since epoch for end of shift |
status | string | false | none | Status for the calendar item |
muteAssignmentNotifications | boolean | false | none | Specifies whether notification for assignment should be muted or not |
name | string | false | none | Name of associated with the calendar item |
CalendarItems
{
"organizationId": "string",
"start": 0,
"end": 0,
"timeZoneName": "string",
"type": "TIME_OFF",
"notes": "string",
"muteAssignmentNotifications": true,
"members": {
"type": "USER",
"userId": "string"
},
"name": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
organizationId | string | true | none | Organization that calendar item belongs to |
start | integer | true | none | Time in millis since epoch for start of shift |
end | integer | true | none | Time in millis since epoch for end of shift |
timeZoneName | string | true | none | Time zone where shift was created |
type | string | true | none | Possible values: TIME_OFF, MEETING, MULTI_ASSIGNEE_SHIFT |
notes | string | false | none | Text description for the calendar item |
muteAssignmentNotifications | boolean | false | none | specifies whether notification for assignment should be muted or not |
members | Members | false | none | none |
name | string | false | none | Display name for the calendar item |
Enumerated Values
Property | Value |
---|---|
type | TIME_OFF |
type | MEETING |
type | MULTI_ASSIGNEE_SHIFT |
CalendarItemsMembers
{
"newCalendarItemStatus": "OPEN",
"shouldReplaceMemberStatuses": true,
"members": {
"type": "INVITE",
"userId": "string",
"groupId": "string",
"fullName": "string",
"countryCode": "string",
"phone": "string",
"initialStatus": "ACCEPTED"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
newCalendarItemStatus | string | true | none | OPEN, ASSIGNED (or any other CalendarItemStatus) |
shouldReplaceMemberStatuses | boolean | true | none | If true, member statuses will be replaced. Otherwise, existing member statuses will not be replaced |
members | CalendarMembers | true | none | none |
Enumerated Values
Property | Value |
---|---|
newCalendarItemStatus | OPEN |
newCalendarItemStatus | ASSIGNED |
CalendarMembers
{
"type": "INVITE",
"userId": "string",
"groupId": "string",
"fullName": "string",
"countryCode": "string",
"phone": "string",
"initialStatus": "ACCEPTED"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
type | string | true | none | ENUM - INVITE, USER, GROUP |
userId | string | false | none | Unique id for user |
groupId | string | false | none | Unique id for group |
fullName | string | false | none | Name for user if invite |
countryCode | string | false | none | Numeric country code for phone number |
phone | string | false | none | Phone number |
initialStatus | string | true | none | ACCEPTED, ASSIGNED, PENDING_RESPONSE, DECLINED, DELETED, ADDITION_REQUESTED, REPLACEMENT_REQUESTED, DENIED |
Enumerated Values
Property | Value |
---|---|
type | INVITE |
type | USER |
type | GROUP |
initialStatus | ACCEPTED |
initialStatus | ASSIGNED |
initialStatus | PENDING_RESPONSE |
initialStatus | DECLINED |
initialStatus | DELETED |
initialStatus | ADDITION_REQUESTED |
initialStatus | REPLACEMENT_REQUESTED |
initialStatus | DENIED |
Members
{
"type": "USER",
"userId": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
type | string | false | none | ENUM - USER |
userId | string | false | none | Unique id for user |
Enumerated Values
Property | Value |
---|---|
type | USER |
AccessResp
{
"accessToken": "string",
"expiresAt": 0,
"acessTokenId": "string",
"scope": [
null
],
"target": "string",
"targetId": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
accessToken | string | false | none | Access token used to allow access to Crew's APIs |
expiresAt | integer | false | none | Epoch seconds of expiration date |
acessTokenId | string | false | none | Unique identifier |
scope | [any] | false | none | List of scopes the acess token has been granted |
target | string | false | none | The type of target -- e.g, ENTERPRISE_ACCOUNT -- the token is associated with |
targetId | string | false | none | The Crew ID of the target |
OrganizationResp
{
"organizationId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
organizationId | OrganizationId | false | none | none |
OrganizationMembershipResp
{
"userId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
},
"organizationId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
},
"createdAt": 0,
"updatedAt": 0,
"permissions": {
"admin": true
},
"profile": {
"title": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
userId | UserId | false | none | none |
organizationId | OrganizationId | false | none | none |
createdAt | integer | false | none | Epoch milliseconds that the membership was created at |
updatedAt | integer | false | none | Epoch milliseconds that the membership was last updated at |
permissions | Permissions | false | none | none |
profile | Profile | false | none | none |
GroupResp
{
"conversationId": "string",
"name": "string",
"numMembers": 0,
"createdAt": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
conversationId | string | false | none | ID of the conversation associated with the group |
name | string | false | none | Name of the group |
numMembers | integer | false | none | Number of members in the group |
createdAt | integer | false | none | Epoch milliseconds that the group was created at |
ConversationResp
{
"id": "string",
"name": "string",
"members": 0
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | ID of the conversation |
name | string | false | none | Name of the conversation |
members | integer | false | none | Number of organization members in the conversation |
EnterpriseResp
{
"organizationId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
organizationId | EnterpriseId | false | none | none |
EnterpriseOrgsResp
{
"organizationId": {
"id": "string",
"updatedAt": 0,
"entityType": "string"
},
"updatedAt": null
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
organizationId | OrganizationId | false | none | none |
updatedAt | any | false | none | Epoch milliseconds that the organization membership was last updated |
UserId
{
"id": "string",
"updatedAt": 0,
"entityType": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | Unique identifier for user |
updatedAt | integer | false | none | Epoch milliseconds that the user was last updated |
entityType | string | false | none | USER |
OrganizationId
{
"id": "string",
"updatedAt": 0,
"entityType": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | Unique identifier for organization |
updatedAt | integer | false | none | Epoch milliseconds that the organization was last updated |
entityType | string | false | none | ORGANIZATION |
EnterpriseId
{
"id": "string",
"updatedAt": 0,
"entityType": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | Unique identifier for enterprise |
updatedAt | integer | false | none | Epoch milliseconds that the enterprise was last updated |
entityType | string | false | none | ENTERPRISE |
Permissions
{
"admin": true
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
admin | boolean | false | none | whether user is an organization admin or not |
Profile
{
"title": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
title | string | false | none | Employees title |
UserResp
{
"id": "string",
"profile": {
"fullName": "string",
"avatarPublicId": "string"
}
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | Unique identifier for user |
profile | UserProfile | false | none | none |
UserProfile
{
"fullName": "string",
"avatarPublicId": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
fullName | string | false | none | Users full name |
avatarPublicId | string | false | none | Unique identifier for users profile picture |
CardInput
{
"templateId": "string",
"content": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
templateId | string | false | none | Template ID for card provided by Crew |
content | string | false | none | Key value pairs that will fill in parts of the card. The supported values and what part of the card they effect will be communicated as designs are finalized |
CardResp
{
"id": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | ID of the resultant card |
MessageInput
{
"conversationId": "string",
"groupId": "string",
"userId": "string",
"text": "string",
"cardId": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
conversationId | string | false | none | ID of the conversation |
groupId | string | false | none | ID of the group |
userId | string | false | none | ID of the user |
text | string | false | none | Text of the message |
cardId | string | false | none | ID of the card being sent in the message |
MessageResp
{
"id": "string"
}
Properties
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
id | string | false | none | ID of the message |