Report the rows a run failed or passed over
const url = 'https://api.sloose.com/orgs/org_9f3c/imports/imp_4d1a/runs/run_7c2e/outcomes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"outcomes":[{"rowKey":"example","module":"example","outcome":"failed","code":"example","message":"example","recordId":"example","phase":"write","target":"example"}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sloose.com/orgs/org_9f3c/imports/imp_4d1a/runs/run_7c2e/outcomes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "outcomes": [ { "rowKey": "example", "module": "example", "outcome": "failed", "code": "example", "message": "example", "recordId": "example", "phase": "write", "target": "example" } ] }'Every module a row settled in the browser as failed or passed over — a formula that threw, a payload it could not build, an ambiguous match, a write that failed (failed), or a row it skipped, filtered, guarded or left alone (skipped), or — in a dry run — a write it would have made (planned, with CREATE or UPDATE as its code) — and every after-save patch that did not fill its field (phase: patch, the field as target) is reported here, up to five hundred at a time, and recorded as attempt 0 beside the attempts the destination answered, so History, the results file and a retry see every failed row after a reload (design §5.4). So is the browser’s word that it made a row’s record after sending the same create and hearing nothing back (made_after_no_answer), which may have made the record too: a flag beside the record’s own answer and never an answer, so the results file and a reopened import still say the record may exist twice when the run’s records do not say the send went unanswered. And so is a dry run’s word that the real run would stop and ask which of several matching records to use (would_ask, with the count as its code, said of the record’s match rather than its write), so a dry run reopened says so as the page that ran it did. A failure is reported even when its write went out, because only the server knows whether it arrived: when it did, the destination’s answer is a later attempt and outranks this one — a row’s outcome is its highest attempt — and when it did not, this is the only record there is. Reporting the same row twice records it once. Only the session or token that authorised the run, while it holds its import.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
The import id.
Example
imp_4d1aThe import id.
The run id, from POST /entitlements/runs/authorise.
Example
run_7c2eThe run id, from POST /entitlements/runs/authorise.
Request Bodyrequired
Section titled “Request Bodyrequired”object
object
failed or skipped, what the browser settled; planned, a dry run’s would-be write; made_after_no_answer, the browser’s word that it made this row’s record in the module after sending the same create and hearing nothing back — so it may exist twice; or would_ask (on the match phase), a dry run’s word that several records matched and the real run would stop and ask which to use, with the count its search found as its code (2, or 10+ when it found as many as it asks for); or lookup (on the lookup phase, the lookup field as target), the browser’s word that a search lookup came to anything but one record — none matched the value in message, blank there was nothing to search by, unworkable its formula could not be worked out, or how many matched it (2, 10+) when the first was linked. Each word is kept beside the record’s own outcome and never stands for it: they are what a reopen says when nothing else in the run’s records does.
On a skipped module passed over because its record already exists (EXISTS, LEFT for a match left as it is, or GUARDED for one whose update guard held it back): the record it found and linked to, which the results file names in the module’s record column (#1460). Ignored on any other outcome, code or phase: a module passed over for any other reason found no record.
Which part of the record this is about: its write (the default), a patch of one field after the save, named by target, its match — which record the write goes to — the one part would_ask is said of, or a lookup of one field, named by target, the one part lookup is said of.
The field a patch fills or a lookup looks up; required with either, ignored otherwise.
Responses
Section titled “Responses”Recorded.
object
How many were new: a row already reported is not recorded twice.
Examplegenerated
{ "recorded": 1}No outcomes, more than five hundred, one that is not failed, skipped, planned, made_after_no_answer, would_ask or lookup, a patch or a lookup that names no field (code: TARGET_REQUIRED), a planned outcome anywhere but a dry run’s write with CREATE or UPDATE as its code (code: NOT_A_PLAN), made_after_no_answer anywhere but the write of a run that writes (code: NOTHING_MADE), or would_ask anywhere but a dry run’s match, or without a count of two or more as its code, or anything but would_ask on a match (code: NOT_A_QUESTION), or lookup anywhere but on a lookup, or with a code that says nothing, or none or a count without the value searched for as its message, or what became of it saying ask in a run that writes or chosen in a dry run, or anything but lookup on a lookup (code: NOT_A_LOOKUP).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}Not the session or token that authorised this run (code: NOT_YOUR_RUN), or the role is too low.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No such import or run, or it is not visible to this session.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The run no longer holds its import (code: LEASE_LOST).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}