Salta ai contenuti

PeopleSync

Questi contenuti non sono ancora disponibili nella tua lingua.

Manage people synchronization tasks, allowing you to upload CSV files and synchronize people, offices, and jobs for a project.
You can create sync tasks and view their status and results.

Version
1.0.0
OpenAPI version
3.0.0
POST
/people-sync/create

Create a new people sync task by uploading a CSV file and specifying the project and sync options.

object
file
required

CSV file that contains data to synchronize.

string format: binary
project_id
required

The project identifier of people to synchronize.

string
b190e786-8b47-4575-9947-3b1f782e6356
pk

The name of the primary key field. It is used to uniquely identify a person.

string
default: code
tax_code
emulation

If true, the request is executed in emulation mode (no changes are made, but the changes and errors are reported).

boolean
0
1
max_changes

Maximum number of changes allowed in the task. If exceeded, the task is aborted.

integer
default: 100
150
sync_type

Defines which datasets will be synchronized. “people” syncs a single person, “offices” syncs person-office associations, “jobs” syncs person-job associations. “offices” requires “people”, “jobs” requires “offices”.

Array<string>
default: people
Allowed values: people offices jobs
[
"people",
"offices",
"jobs"
]

Task was created and put in queue

object
task_id

The created task ID. Use it to retrieve the current task status via the /view endpoint.

string
task-1234
Example
{
"task_id": "task-1234"
}

Bad request. Required parameter missing or invalid value.

Not allowed to synchronize data on the specified project due to permissions.

CSV file is too large.

Unknown internal server error.

GET
/people-sync/view/{id}

Retrieve the status and result of a people sync task by its unique ID.

id
required
string

The task identifier

The requested task data

object
task_id

Task identifier

string
task-1234
user_id

Identifier of the user who created the task

string
admin@myproject.com
status

The current task status

string
Allowed values: TODO PENDING PROCESSING DONE FAILED
response
object
result
object
{
"PS2": [
{
"id": "PS2",
"action": "activate",
"periods": [
{
"end_date": "2021-07-01 00:00:00",
"start_date": "2020-07-01 00:00:0"
},
{
"end_date": "",
"start_date": "2023-06-08 00:00:00"
}
]
}
],
"PS3": [
{
"id": "PS3",
"action": "add"
}
],
"PS4": [
{
"id": "PS4",
"action": "deactivate",
"periods": [
{
"end_date": "2023-06-08 00:00:00",
"start_date": "2020-07-01 00:00:00"
}
]
}
],
"PS5": [
{
"id": "PS5",
"action": "update",
"changes": {
"street": "New street address",
"locality": "New locality"
}
}
],
"PS6": [
{
"id": "OF2",
"action": "add"
},
{
"id": "OF1",
"action": "deactivate",
"periods": [
{
"end_date": "2023-06-14 00:00:00",
"start_date": "1970-01-01 00:00:00"
}
]
},
{
"id": "OF2-JOB1",
"action": "add"
}
]
}
errors

It lists eventually task execution errors

Array<object>
object
line

CSV file line that cointains the error

integer
9
message

The error esplication

string
Invalid office code OF1234
info

Error additional informations

string
...
changes

It presents a summary of the applied changes after the task execution.

object
add

The total number of add operations

integer
2
update

The total number of update operations

integer
3
activate

The total number of activate operations

integer
5
deactivate

The total number of deactivate operations

integer
4
total

The total number of operations executed

integer
14
created_at

Date time when task was created

string
2023-06-30 10:40:00
updated_at

Date time when task was updated last

string
2023-06-30 10:40:00
Example
{
"task_id": "task-1234",
"user_id": "admin@myproject.com",
"status": "DONE",
"response": {
"result": {
"PS2": [
{
"id": "PS2",
"action": "activate",
"periods": [
{
"end_date": "2021-07-01 00:00:00",
"start_date": "2020-07-01 00:00:00"
},
{
"end_date": "",
"start_date": "2023-06-08 00:00:00"
}
]
}
],
"PS3": [
{
"id": "PS3",
"action": "add"
}
],
"PS4": [
{
"id": "PS4",
"action": "deactivate",
"periods": [
{
"end_date": "2023-06-08 00:00:00",
"start_date": "2020-07-01 00:00:00"
}
]
}
],
"PS5": [
{
"id": "PS5",
"action": "update",
"changes": {
"street": "New street address",
"locality": "New locality"
}
}
],
"PS6": [
{
"id": "OF2",
"action": "add"
},
{
"id": "OF1",
"action": "deactivate",
"periods": [
{
"end_date": "2023-06-14 00:00:00",
"start_date": "1970-01-01 00:00:00"
}
]
},
{
"id": "OF2-JOB1",
"action": "add"
}
]
},
"errors": [
{
"line": 9,
"message": "Invalid office code OF1234",
"info": "..."
}
],
"changes": {
"add": 2,
"update": 3,
"activate": 5,
"deactivate": 4,
"total": 14
}
},
"created_at": "2023-06-30 10:40:00",
"updated_at": "2023-06-30 10:40:00"
}

Not allowed to fetch task data due to permissions.