Sharing Environments

Invite User to Environment

Given a user email, gives another user access to a specific environment. Returns the information for the environment.

POST api/environment/invites

Permissions

User must be logged in. User must be an admin of the environment.

Sample Request Body

{
 "environmentId": 1,
 "userEmail": "user@email.com"
}

Success Response

200 OK
{
    "id": 2,
    "environmentId": 1,
    "userId": 1,
    "isAdmin": false,
    "inviteCode": "XXXXXXXX",
    "accepted": false,
    "createdAt": 1526761026983
}

Error Response

400 BAD REQUEST
{
    "code": 400,
    "message": "User user2@email.com does not exist"
}
403 FORBIDDEN
{
    "code": 403,
    "message": "Only environment administrators can invite"
}
404 NOT FOUND
{
    "code": 404,
    "message": "Environment X does not exist"
}

Accept Invite to Environment

User accepts the invitation to an environment so that they have access to it.

PUT api/environments/invites/accept

Permissions

User must be logged in.

Sample Request Body

{
 "inviteCode": "XXXXXXXX"
}

Success Response

200 OK
{
    "id": 1,
    "envName": "Test Environment 1",
    "ownerId": 1,
    "keysId": 1,
    "keysName": "myKeys",
    "accessKey": "XXXXXXXXXX",
    "secretKey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "region": "us-east-2",
    "dbName": "DB",
"host" : "xxxxx.xxxxx.us-east-2.rds.amazonaws.com",
    "user": "user",
    "pass": "pass",
    "instance": "XXXXXXX",
    "parameterGroup": "paramGroup",
    "bucket": "testBucket",
    "prefix": null
}

Error Response

404 NOT FOUND
{
    "code": 404,
    "message": "Environment X does not exist"
}
409 CONFLICT
{
    "code": 409,
    "message": "Invite has already been accepted"
}
{
    "code": 409,
    "message": "Invitation has expired"
}

Last updated