Skip to main content

Invite member

Invite members for project, personal project and team project has different api

Invite member for personal project

Request

curl -vvv -X POST "$API_HOST/open/api/v1/projects/$project_id/members/invitations/personal/" -H "Authorization: $access-token" -d '$request_body'

Request example

{
"members": [
{
"phoneOrEmail": "aa@elgo.cc",
"role": "admin"
},
{
"phoneOrEmail": "neal2@elgo.cc",
"role": "admin"
}
]
}

Parameter description

NameTypeDescriptionRequired
membersarraymember info
∟ rolestringmember roleY
∟ phoneOrEmailstringphone or emaily

Python example

def invite_personal_project_member(access_token, project_id):
url = '%s/open/api/v1/projects/%d/members/invitations/personal/' % (API_HOST, project_id)
headers = {'Authorization': access_token}
data = {
"members": [
{
"phoneOrEmail": "aa@elgo.cc",
"role": "admin"
},
{
"phoneOrEmail": "neal2@elgo.cc",
"role": "admin"
}
]
}
req = requests.post(url, headers=headers, json=data)
return req.json()

Response example

{
"code": 0,
"detail": null,
"extra": null,
"message": "OK",
"requestID": null
}

Invite member for team project

Request

curl -vvv -X POST "$API_HOST/open/api/v1/projects/$project_id/members/invitations/team/" -H "Authorization: $access-token" -d '$request_body'

Request example

{
"members": [
{
"id": 3,
"role": "admin"
}
]
}

Parameter description

NameTypeDescriptionRequired
membersarraymember info
∟ idint64user idy
∟ rolestringmember roleY

Python example

def invite_team_project_member(access_token, project_id):
url = '%s/open/api/v1/projects/%d/members/invitations/team/' % (API_HOST, project_id)
headers = {'Authorization': access_token}
data = {
"members": [
{
"id": 3,
"role": "admin"
}
]
}
req = requests.post(url, headers=headers, json=data)
return req.json()

Response example

{
"code": 0,
"detail": null,
"extra": null,
"message": "OK",
"requestID": null
}