Import persons from Shotgun. Send a JSON list of Shotgun rows. A person that exists in Kitsu, with the same Shotgun identifier or the same email, is not changed, but their department is set to the department of the row. Else, the person is created. The role is manager or admin when permission_rule_set.name is Manager or Admin, user otherwise. A row with the email changeme@email.com is skipped. A row that misses a field is skipped. You must be an administrator.
POST
/import/shotgun/persons
curl
curl -X POST "http://api.example.com/import/shotgun/persons" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '[
{
"id": 12345,
"firstname": "John",
"lastname": "Doe",
"email": "john.doe@example.com",
"login": "jdoe",
"sg_status_list": "act",
"permission_rule_set": {
"name": "Manager"
},
"department": {
"name": "Animation"
}
}
]'
import requests
url = "http://api.example.com/import/shotgun/persons"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json",
"Content-Type": "application/json"
}
params = {}
payload = [
{
"id": 12345,
"firstname": "John",
"lastname": "Doe",
"email": "john.doe@example.com",
"login": "jdoe",
"sg_status_list": "act",
"permission_rule_set": {
"name": "Manager"
},
"department": {
"name": "Animation"
}
}
]
response = requests.post(
url,
headers=headers,
params=params,
json=payload
)
response.raise_for_status()
if response.content:
print(response.json())
Request example
[
{
"id": 12345,
"firstname": "John",
"lastname": "Doe",
"email": "john.doe@example.com",
"login": "jdoe",
"sg_status_list": "act",
"permission_rule_set": {
"name": "Manager"
},
"department": {
"name": "Animation"
}
}
]
Response examples (200)
[
{
"id": "a24a6ea4-ce75-4665-a070-57453082c250",
"first_name": "John",
"last_name": "Doe",
"email": "john.doe@example.com",
"role": "manager",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:00:00Z"
}
]