Skip to content

Commit

Permalink
style(lint): Auto commit lint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
getsantry[bot] authored Jul 13, 2023
1 parent ca03741 commit ad4ed3f
Showing 1 changed file with 141 additions and 139 deletions.
280 changes: 141 additions & 139 deletions src/api/tutorial.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ For this guide, we will generate an organization auth token by creating an inter

1. Under "Permissions" select "Read & Write" in the "Organization" dropdown.

Creating a new team requires an auth token with organization write permissions. Listing teams only requires read permissions.
Creating a new team requires an auth token with organization write permissions. Listing teams only requires read permissions.

1. Press "Save Changes".

1. Scroll down to the bottom of the page and copy the generated token under "Tokens".

You'll need this token for all your future API calls.
You'll need this token for all your future API calls.

## List an Organization's Teams

Expand All @@ -57,112 +57,114 @@ You can find your organization ID in the browser URL of your Sentry instance. Fo

1. Save your auth token and organization ID as environment variables for ease of use. Paste the following commands into your terminal, replacing `<organization_id>` with your organization ID and `<auth_token>` with the auth token you copied previously:

```bash
export SENTRY_ORG_ID=<organization_id>
export SENTRY_AUTH_TOKEN=<auth_token>
```
```bash
export SENTRY_ORG_ID=<organization_id>
export SENTRY_AUTH_TOKEN=<auth_token>
```

1. Paste the following cURL command into your terminal:

```bash
curl "https://sentry.io/api/0/organizations/$SENTRY_ORG_ID/teams/?detailed=0" \
-H 'Authorization: Bearer '$SENTRY_AUTH_TOKEN
``
```bash
curl "https://sentry.io/api/0/organizations/$SENTRY_ORG_ID/teams/?detailed=0" \
-H 'Authorization: Bearer '$SENTRY_AUTH_TOKEN
``
```

1. Here's an example of what the output of the command should be, for an organization that has a team called "test-team":
```json
[
{
"id": "4505449964175360",
"slug": "test-team",
"name": "test-team",
"dateCreated": "2023-06-30T18:44:59.196618Z",
"isMember": false,
"teamRole": null,
"flags": {
"idp:provisioned": false
},
"access": [
"alerts:read",
"team:read",
"member:read",
"org:read",
"project:releases",
"project:read",
"event:write",
"event:read"
],
"hasAccess": true,
"isPending": false,
"memberCount": 1,
"avatar": {
"avatarType": "letter_avatar",
"avatarUuid": null
},
"orgRole": null,
}
]
```
The output gives you details about the teams within the specified organization.
If your organization has enough teams, the API will return paginated results. See our docs on [Pagination](/api/pagination/) to learn how to handle paginated results.
```json
[
{
"id": "4505449964175360",
"slug": "test-team",
"name": "test-team",
"dateCreated": "2023-06-30T18:44:59.196618Z",
"isMember": false,
"teamRole": null,
"flags": {
"idp:provisioned": false
},
"access": [
"alerts:read",
"team:read",
"member:read",
"org:read",
"project:releases",
"project:read",
"event:write",
"event:read"
],
"hasAccess": true,
"isPending": false,
"memberCount": 1,
"avatar": {
"avatarType": "letter_avatar",
"avatarUuid": null
},
"orgRole": null
}
]
```
The output gives you details about the teams within the specified organization.
If your organization has enough teams, the API will return paginated results. See our docs on [Pagination](/api/pagination/) to learn how to handle paginated results.
1. [Optional] To list information about the projects associated with each team you can use the set the `detailed` query parameter to `1`:
```bash
curl "https://sentry.io/api/0/organizations/$SENTRY_ORG_ID/teams/?detailed=1" \
-H 'Authorization: Bearer '$SENTRY_AUTH_TOKEN
```
Here's an example of what that output might look like if "test-team" has one associated project named "test-project":
```json
[
{
...
"orgRole": null,
"externalTeams": [],
"projects": [
{
"id": "4505506997403648",
"slug": "test-project",
"name": "test-project",
"platform": "javascript-react",
"dateCreated": "2023-07-10T20:29:17.426792Z",
"isBookmarked": false,
"isMember": false,
"features": [
"alert-filters",
"minidump",
"race-free-group-creation",
"similarity-indexing",
"similarity-view",
"releases"
],
"firstEvent": "2023-07-10T20:39:35.811000Z",
"firstTransactionEvent": true,
"access": [],
"hasAccess": true,
"hasMinifiedStackTrace": true,
"hasMonitors": false,
"hasProfiles": false,
"hasReplays": true,
"hasSessions": true,
"isInternal": false,
"isPublic": false,
"avatar": {
"avatarType": "letter_avatar",
"avatarUuid": null
},
"color": "#bf853f",
"status": "active"
}
]
}
]
```
```bash
curl "https://sentry.io/api/0/organizations/$SENTRY_ORG_ID/teams/?detailed=1" \
-H 'Authorization: Bearer '$SENTRY_AUTH_TOKEN
```
Here's an example of what that output might look like if "test-team" has one associated project named "test-project":

```json
[
{
...
"orgRole": null,
"externalTeams": [],
"projects": [
{
"id": "4505506997403648",
"slug": "test-project",
"name": "test-project",
"platform": "javascript-react",
"dateCreated": "2023-07-10T20:29:17.426792Z",
"isBookmarked": false,
"isMember": false,
"features": [
"alert-filters",
"minidump",
"race-free-group-creation",
"similarity-indexing",
"similarity-view",
"releases"
],
"firstEvent": "2023-07-10T20:39:35.811000Z",
"firstTransactionEvent": true,
"access": [],
"hasAccess": true,
"hasMinifiedStackTrace": true,
"hasMonitors": false,
"hasProfiles": false,
"hasReplays": true,
"hasSessions": true,
"isInternal": false,
"isPublic": false,
"avatar": {
"avatarType": "letter_avatar",
"avatarUuid": null
},
"color": "#bf853f",
"status": "active"
}
]
}
]
```

## Create a Team

Expand All @@ -172,53 +174,53 @@ Now that you know what teams already exist in your org, use the [Create a New Te

1. Paste the following cURL command into your terminal:

```bash
curl -d "name=tutorial-team" -X POST "https://sentry.io/api/0/organizations/$SENTRY_ORG_ID/teams/" \
-H 'Authorization: Bearer '$SENTRY_AUTH_TOKEN
```
```bash
curl -d "name=tutorial-team" -X POST "https://sentry.io/api/0/organizations/$SENTRY_ORG_ID/teams/" \
-H 'Authorization: Bearer '$SENTRY_AUTH_TOKEN
```

The `name` query parameter means the name of the created team should be "tutorial-team".
The `name` query parameter means the name of the created team should be "tutorial-team".

1. Here's an example of what the output of the command should be:
```json
{
"id": "4505524553711616",
"slug": "tutorial-team",
"name": "tutorial-team",
"dateCreated": "2023-07-13T22:54:05.074990Z",
"isMember": false,
"teamRole": null,
"flags": {
"idp:provisioned": false
},
"access": [
"event:write",
"member:read",
"alerts:read",
"project:releases",
"project:read",
"event:read",
"team:read",
"org:read"
],
"hasAccess": true,
"isPending": false,
"memberCount": 0,
"avatar": {
"avatarType": "letter_avatar",
"avatarUuid": null
},
"orgRole": null
}
```
```json
{
"id": "4505524553711616",
"slug": "tutorial-team",
"name": "tutorial-team",
"dateCreated": "2023-07-13T22:54:05.074990Z",
"isMember": false,
"teamRole": null,
"flags": {
"idp:provisioned": false
},
"access": [
"event:write",
"member:read",
"alerts:read",
"project:releases",
"project:read",
"event:read",
"team:read",
"org:read"
],
"hasAccess": true,
"isPending": false,
"memberCount": 0,
"avatar": {
"avatarType": "letter_avatar",
"avatarUuid": null
},
"orgRole": null
}
```
1. [Optional] To create a team where the `slug` value is different than the `name` value, you can specify both in your POST call, like so:
```bash
curl -d "name=tutorial-team&slug=tutorial-team-slug" -X POST "https://sentry.io/api/0/organizations/$SENTRY_ORG_ID/teams/" \
-H 'Authorization: Bearer '$SENTRY_AUTH_TOKEN
```
```bash
curl -d "name=tutorial-team&slug=tutorial-team-slug" -X POST "https://sentry.io/api/0/organizations/$SENTRY_ORG_ID/teams/" \
-H 'Authorization: Bearer '$SENTRY_AUTH_TOKEN
```
## List an Organization's Teams

Expand Down

0 comments on commit ad4ed3f

Please sign in to comment.