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 Method | URL |
---|---|
POST | https://api.netux.com/api/v2.0/organizations/_/bulk/create/ |
Parámetros de consulta
Parameter | Type | Use | Description |
---|---|---|---|
token | String | Authentication | Authentication 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:
Parameter | Type | Required? | Default Value | Description |
---|---|---|---|---|
label | String | Yes | N/A (required) | API label of Organization |
name | String | No | Same as label | Name of Organization |
description | String | No | "" | Description of Organization |
favicon | Image | No | null | Icon of the Organization. How to send the favicon as body attribute |
logo | Image | No | null | Logo of the Organization. How to send the logo as body attribute |
properties | Object | No | {} | Organization properties. Valid properties are: color |
isActive | Boolean | No | True | Is True when Organization is active |
app | <app_key> | No | null | Key of App (id or label) |
Cabecera
Parameter | Required? | Description |
---|---|---|
X-Auth-Token | Yes | Authentication Token of account |
X-Bulk-Operation | Boolean | Need to be set to True for the bulk operation to work |
Content-Type | String (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."
}