Team

Team is identified by {team_id}. A team object in Moxtra provides the following properties:

Name Description Example
id The team ID. PRTA3fRhzcxEPit77Dw063F
name The team name. John's team
created_time The timestamp, when the team object was created. 1348864985783
updated_time The timestamp, when the team object was updated. 1348864985783

Name Description Example
owner Whether the member is the team owner. true, false
created_time The timestamp, when the team member object was created. 1348864985783
updated_time The timestamp, when the team member object was updated. 1348864985783
user_id (In member) User ID. UiaduESWsbzFoK9TOldC6zF
name (In member) The full name of the user. John Doe
email (In member) The email address of the user if not having unique_id. john.doe@acme.com
unique_id (In member) Unique_id of the user if not having email. A453224
org_id (In member) The org id if the user belongs to an org. PZCuoBuYrnO4NXsdTmn4gP5

Get Team

Get the contents of a team object identified by {team_id}.

GET /teams/{team_id}

Sample Request
GET /teams/PRTA3fRhzcxEPit77Dw063F
Sample Response
{
    "code": "RESPONSE_SUCCESS",
    "data": {
        "id": "PRTA3fRhzcxEPit77Dw063F",
        "name": "John's team",
        "members": [
            {
                "owner": false,
                "created_time": 1467327047209,
                "updated_time": 1468541973985,
                "member": {
                    "user_id": "Utkj3YC5BxRHCCaq9widP67",
                    "name": "Joe Wess",
                    "email": "jwess@gmail.com",
                    "unique_id": "",
                    "org_id": ""
                }
            },
            {
                "owner": true,
                "created_time": 1348864985783,
                "updated_time": 1348864985783,
                "member": {
                    "user_id": "UiaduESWsbzFoK9TOldC6zF",
                    "name": "John Doe",
                    "email": "john.doe@acme.com",
                    "unique_id": "",
                    "org_id": ""
                }
            }
        ]
        "created_time": 1467327047209,
        "updated_time": 1468541973985
    }
}

Create Team

Create a team identified by {user_id}.

POST /{user_id}/teams

JSON Parameters
Name Type Description
name String Name of the team.
Sample Request
POST /me/teams
{
    "name": "John's team"
}
Sample Response
{
    "code": "RESPONSE_SUCCESS",
    "data": {
        "id": "PRTA3fRhzcxEPit77Dw063F",
        "name": "John's team",
        "created_time": 1467327047209,
        "updated_time": 1467327047209
    }
}

Update Team

Update a team identified by {team_id} with input new value(s).

POST /teams/{team_id}

JSON Parameters
Name Type Description
name String Name of the team.
Sample Request
POST /teams/PRTA3fRhzcxEPit77Dw063F
{
    "name": "John's new team"
}
Sample Response
{
    "code": "RESPONSE_SUCCESS",
    "data": {
        "id": "PRTA3fRhzcxEPit77Dw063F",
        "name": "John's new team",
        "created_time": 1467327047209,
        "updated_time": 1468541973985
    }
}

Delete Team

Delete a team by the team owner identified by {team_id}.

DELETE /teams/{team_id}

Sample Request
DELETE /teams/PRTA3fRhzcxEPit77Dw063F
Sample Response
{
    "code": "RESPONSE_SUCCESS"
}

Add Users to Team

Add users to the team by the team owner identified by {team_id} via email or user_id.

POST /teams/{team_id}/adduser

JSON Parameters
Name Type Description
email (In member of members array) String Email address of the contact to be added.
user_id (In member of members array) String User id to be added.
unique_id (In member of members array) String Optional: org_id + unique_id for org user to be added.
org_id (In member of members array) String Optional: org_id + unique_id for org user to be added.
email_off Boolean Optional: Whether to turn off sending email. Default is false.
notification_off Boolean Optional: Whether to turn off push notification. Default is false.
Sample Request
POST /teams/PRTA3fRhzcxEPit77Dw063F/adduser
{
    "members": [
    {
        "member": {
            "email": "test@gmail.com"
        }
    },
    {
        "member": {
            "unique_id": "A453224",
            "org_id": "PTHpzIJ4jGx1upvgjWZa4S1"
        }
    }
    ]
}
Sample Response
{
    "code": "RESPONSE_SUCCESS"
}

Remove User from Team

Remove a team member by the team owner identified by {team_id} via email or user_id.

POST /teams/{team_id}/removeuser

JSON Parameters
Name Type Description
email String Email address of an existing member in the team.
user_id String User id of an existing member in the team.
unique_id String Optional: org_id + unique_id for the existing team member to be removed.
org_id String Optional: org_id + unique_id for the existing team member to be removed.
email_off Boolean Optional: Whether to turn off sending email. Default is false.
notification_off Boolean Optional: Whether to turn off push notification. Default is false.
Sample Request using email
POST /teams/PRTA3fRhzcxEPit77Dw063F/removeuser
{
    "email": "joe@test.com"
}
Sample Request using user_id
POST /teams/PRTA3fRhzcxEPit77Dw063F/removeuser
{
    "user_id": "UiaduESWsbzFoK9TOldC6zF"
}
Sample Response
{
    "code": "RESPONSE_SUCCESS"
}

Remove Me from Team

Remove me from a team where I am a team member or an invitee rejects an invitation to the team identified by {team_id}.

POST /teams/{team_id}/removeme

Sample Request
POST /teams/PRTA3fRhzcxEPit77Dw063F/removeme
Sample Response
{
    "code": "RESPONSE_SUCCESS"
}

Reassign Team Owner

Reassign a team member to become the team owner identified by {team_id} via email or user_id.

POST /teams/{team_id}/reassignowner

JSON Parameters
Name Type Description
email String Email address of an existing member in the team.
user_id String User id of an existing member in the team.
unique_id String Optional: org_id + unique_id for the existing team member.
org_id String Optional: org_id + unique_id for the existing team member.
Sample Request
POST /teams/PRTA3fRhzcxEPit77Dw063F/reassignowner
{
    "user_id": "UiaduESWsbzFoK9TOldC6zF"
}
Sample Response
{
    "code": "RESPONSE_SUCCESS"
}