Operación Bulk: Crear Organizations

Este endpoint crea una o más nuevas Organizations.

Solicitud HTTP

Para crear múltiples nuevas Organizations, haz una petición POST a la siguiente URL:

HTTP MethodURL
POSThttps://api.netux.com/api/v2.0/organizations/_/bulk/create/

Parámetros de consulta

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter.

Parámetros de cuerpo

El cuerpo es un array que contiene objetos JSON correspondientes a Organizations. Cada objeto de Organization puede contener los siguientes parámetros de cuerpo:

ParameterTypeRequired?Default ValueDescription
labelStringYesN/A (required)API label of Organization
nameStringNoSame as labelName of Organization
descriptionStringNo""Description of Organization
faviconImageNonullIcon of the Organization. How to send the favicon as body attribute
logoImageNonullLogo of the Organization. How to send the logo as body attribute
propertiesObjectNo{}Organization properties. Valid properties are: color
isActiveBooleanNoTrueIs True when Organization is active
app<app_key>NonullKey of App (id or label)

Cabecera

ParameterRequired?Description
X-Auth-TokenYesAuthentication Token of account
X-Bulk-OperationBooleanNeed to be set to True for the bulk operation to work
Content-TypeString (application/json)Content type of body
curl -X POST 'https://api.netux.com/api/v2.0/organizations/_/bulk/create/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -H 'X-Bulk-Operation: True' \
 -d '[
  {
    "label": "first-organization",
    "name": "First Organization"
  },
  {
    "label": "second-organization",
    "description": "Description of second Organization"
  },
  {
    "label": "third-organization",
    "properties": {"color": "#BADA55"}
  }
]'

Respuesta

Devuelve un Task Id del proceso asíncrono.

{
  "task": {
    "id": "tyg54645501a9ca5714e7b098721"
  }
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}
{
    "detail": "Header `X-BULK-OPERATION` should be provided for bulk operation."
}