Create or update results or master data

Use this API operation to create or update quality results in analysis sets or master data in selection lists.

Returns 400 Bad Request if results is empty, or if editOnly is used without keyField. Returns 413 Payload Too Large if results contains more than 1,000 results.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Body Params
integer
required

The unique id of the analysis set or selection list.

This parameter is required and has no default.

Note: for historical reasons, this parameter is usually called maskid in AlisQI URLs. The API uses setId for consistency with the terminology used in the user interface.

string
required

JSON array of result objects, as a string. It must contain at least 1 and at most 1,000 results.

Each result object has one key/value pair per field. Two pseudo-fields are also supported:

  • @id: the id of an existing result. Only used with keyField=@id (see keyField).

  • @attachments: an array of attachments. Each attachment is an object with filename (the file name, including the extension) and data (the base64-encoded content of the file). This is the same format that getResults returns with includeAttachments=true.

Example:

[
  {
    "date": "2023-08-08 19:19:02",
    "product_": "Asy Novelo",
    "batch_": "B150125",
    "status_": "In production",
    "@attachments": [
      {
        "filename": "Supplier's CoA.pdf",
        "data": "JVBERi0xLjUKJcOkw7…"
      }
    ]
  }
]

Attachments when modifying an existing result (with keyField):

@attachmentsEffect on the existing result
Left outThe existing attachments are kept.
[]All existing attachments are deleted.
A listThe list replaces all existing attachments. Files with the same content as an existing attachment are kept (and their titles updated), new files are added, and existing attachments that are not in the list are deleted.

To add an attachment to a result that already has attachments, send the complete list. You can retrieve it with getResults and includeAttachments=true.

Tip: Call the getResults endpoint to see the exact Result data structure for this setId.

string

Find and modify existing results based on this field's value.

Use keyField=@id to find existing results by their id: each result object must then contain the pseudo-field @id with the id of the result to modify. Use getResults with includeId=true to get these ids.

Defaults to none, meaning new results will be created.

If a key field is specified, AlisQI will try to find an existing result that matches the provided result's value for that field. If one is found, the existing result's values are merged with those provided and the result is modified. If no existing result is found, a new one is created.

You can prevent the creation of new results by setting editOnly=true. When set, AlisQI will not create new results. Instead, an error message is provided for each result that has no matching existing result.
Use this to prevent accidental creation of results when key field values might not match up exactly.

Note that the key field evaluation is case sensitive.
When a key field is used, you only need to specify the values that you want to change. These will be merged with the existing values. That means you can even leave out values for required fields.
However, if no existing result is found, AlisQI will try to modify or create a result using only the partial result!
If you wish to remove a value, specify "field": null in the Result.

boolean
Defaults to false

Use (only) in conjunction with keyField. Enable to prevent (accidental) creation of new results.

Defaults to false. Specifying editOnly=true without keyField results in 400 Bad Request.

boolean
Defaults to false

Create new selection list options if an unknown value is specified?

Defaults to false to prevent accidental duplicates or noise in master data.

Responses

null if no error occurred.

X-RateLimit-Retry-After.

Language
Credentials
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json