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
User must be logged in. User must be an admin of the environment.
{
"environmentId": 1,
"userEmail": "user@email.com"
}
{
"id": 2,
"environmentId": 1,
"userId": 1,
"isAdmin": false,
"inviteCode": "XXXXXXXX",
"accepted": false,
"createdAt": 1526761026983
}
{
"code": 400,
"message": "User user2@email.com does not exist"
}
{
"code": 403,
"message": "Only environment administrators can invite"
}
{
"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
User must be logged in.
{
"inviteCode": "XXXXXXXX"
}
{
"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
}
{
"code": 404,
"message": "Environment X does not exist"
}
{
"code": 409,
"message": "Invite has already been accepted"
}
{
"code": 409,
"message": "Invitation has expired"
}