import_write
Import historic data into Phasio: companies, contacts, addresses, parts with their files, quotes and orders, and the history of an order: routings, production, shipments and messages. You resolve every ambiguity yourself: find existing rows with the query tools and name them {"id": "..."}; give each operation a key (the item's id in the source system) and name rows of this or an earlier import {"ref": ""}. Add operations in dependency order (a company before its address, a part before its order, an order before its production, shipments and messages). The user reviews each operation before the approval. Give an operation a note when the user must know why: for example why you matched an existing row, or what you assumed for a missing value. Workflow: action=create (title) -> action=add (planId, operations [{key, op, args, note?}], in parts; the same key replaces an operation) -> after the last add, action=split (planId): a large plan becomes a queue of batches, each a plan with its own planId, run in order; a small plan stays as it is -> action=dry_run (planId); a dry run splits a large plan on its own, keeps batch 1 under the planId and tests batch 1 only -> fix the errors with add or remove (planId, keys) and run again -> when the dry run has no errors, ask the user to review, approve and apply the plan in Phasio (Imports); you cannot approve or apply -> when the status is APPLIED (import_read action=plan), upload each file: POST a multipart form with the part "file" to its uploadUrl, with your bearer token. Upload ONE file at a time and wait for the answer; each CAD file starts an analysis. The limit is 20 uploads a minute; on HTTP 429 wait one minute. Only the user can undo an applied plan, in Phasio (Imports); you cannot undo. An undo is refused after the first file of the plan is uploaded: ask the user to confirm the applied plan before you upload. Batches: the answer of a batch names its queue and the batch whose turn it is (turn). Work only on the batch whose turn it is: dry-run it and fix it with add or remove on its own planId (a batch takes at most a tenth more operations than the batch size, room for fixes: IMPORT_BATCH_FULL); a later batch that names rows of an earlier one fails its dry run until the user applied that batch. import_read action=operations describes the args of each operation.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | No | ||
| title | No | ||
| action | Yes | ||
| planId | No | ||
| operations | No |