Skip to content

Latest commit

 

History

History
66 lines (51 loc) · 2 KB

File metadata and controls

66 lines (51 loc) · 2 KB

New

Creates a new import operation; If an operation was already running, it will be aborted. Any data from previous imports will be cleared automatically.

{% hint style="info" %} It requires the run-import permission. {% endhint %}

URL Requires Auth HTTP Method
/api/v1/import.new yes POST

Headers

ArgumentExampleRequiredDescription
X-User-Idmyuser-nameRequiredThe authenticated user ID.
X-Auth-Tokenmyauth-tokenRequiredAuth token.

Example Call

curl --location --request POST 'http://localhost:3000/api/v1/import.new' \
--header 'x-auth-token: QizJozLOnWMi_2vWaLHhjfd-XYKT6XM40lTZ3zg1UMd' \
--header 'x-user-id: rbAXPnMktTFbNpwtJ' \
--header 'Content-Type: application/json' \
--data ''

Example Result

Success

{
    "operation": {
        "_id": "64d69545ee8ae821983005f5",
        "type": "api",
        "importerKey": "api",
        "ts": "2023-08-11T20:08:37.655Z",
        "status": "importer_new",
        "valid": true,
        "user": "rbAXPnMktTFbNpwtJ",
        "_updatedAt": "2023-08-11T20:08:37.655Z"
    },
    "success": true
}

Error

  • No Permission: This occurs when the authenticated user doesn't have the run-import permission.

{% tabs %} {% tab title="No Permission" %}

{
    "success": false,
    "error": "User does not have the permissions required for this action [error-unauthorized]"
}

{% endtab %} {% endtabs %}

Change Log

Version Description
6.3.0 Added