Send project invitation
import requests
url = "https://api.diga.io/v1/project/invitation/send"
payload = {
"email": "<string>",
"role": "member"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', role: 'member'})
};
fetch('https://api.diga.io/v1/project/invitation/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.diga.io/v1/project/invitation/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"role": "member"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.diga.io/v1/project/invitation/send"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"role\": \"member\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invited_email": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"registered": true,
"expires_at": "2023-11-07T05:31:56Z",
"inviter_name": "<string>",
"invited_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": "error",
"error_code": "INVALID_EMAIL",
"message": "The email invalid@email is not valid"
}{
"status": "error",
"error_code": "PROJECT_NOT_FOUND",
"message": "Project 550e8400-e29b-41d4-a716-446655440000 not found"
}{
"status": "error",
"error_code": "PROFILE_ALREADY_IN_PROJECT",
"message": "Profile with email user@example.com is already in the company"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"status": "error",
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Error: Internal Server Error"
}Project Invitations
Send project invitation
Send an email invitation to a user to join your project.
POST
/
v1
/
project
/
invitation
/
send
Send project invitation
import requests
url = "https://api.diga.io/v1/project/invitation/send"
payload = {
"email": "<string>",
"role": "member"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', role: 'member'})
};
fetch('https://api.diga.io/v1/project/invitation/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.diga.io/v1/project/invitation/send \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email": "<string>",
"role": "member"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.diga.io/v1/project/invitation/send"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"role\": \"member\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invited_email": "<string>",
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project_name": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"registered": true,
"expires_at": "2023-11-07T05:31:56Z",
"inviter_name": "<string>",
"invited_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": "error",
"error_code": "INVALID_EMAIL",
"message": "The email invalid@email is not valid"
}{
"status": "error",
"error_code": "PROJECT_NOT_FOUND",
"message": "Project 550e8400-e29b-41d4-a716-446655440000 not found"
}{
"status": "error",
"error_code": "PROFILE_ALREADY_IN_PROJECT",
"message": "Profile with email user@example.com is already in the company"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"status": "error",
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Error: Internal Server Error"
}Autorizaciones
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Cuerpo
application/json
Respuesta
Successful Response
Opciones disponibles:
admin, member, reader ⌘I

