Crear Organization

Este endpoint crea una nueva Organization.

Solicitud HTTP

Para crear una nueva Organization, haz una petición POST a la siguiente URL:

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

Parámetros de consulta

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter

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, this attribute has to be sent as form-data (-F favicon=/path/logo.png)
logoImageNonullUrl of image or logo
propertiesObjectNo{}Organization properties.
isActiveBooleanNoTrueIs True when Organization is active
app<app_key>NonullKey of App (id or label)

🚧

Actualizando favicon y logo

Nuestro backend es tan potente que puede manejar archivos. Sin embargo, hay una pequeña consideración, los datos deben ser enviados como form-data. Esto significa simplemente una flag diferente en el curl. Además, es importante saber que también se pueden enviar los otros atributos como form-data. A continuación un ejemplo:

curl -X POST 'https://api.netux.com/api/v2.0/organizations/' \ 
-H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \ 
-F 'favicon=path/logo.png' \
-F 'logo=@logoname'

Cabecera

ParameterTypeDescription
X-Auth-TokenStringAuthentication Token of account
Content-TypeString (application/json)Content type of body
curl -X POST 'https://api.netux.com/api/v2.0/organizations/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
    "name": "My Second Customer",
    "label": "my-second-customer",
    "description": "Other Organization",
    "properties": {"color": "#BADA55"},
    "isActive": true,
    "app": "~my_application"
}'

Respuesta

Devuelve un objeto Organization con la Organization creada.

{
    "count": 1,
    "next": null,
    "previous": null,
    "results": [
        {
            "app": {
                "id": "5dfa39901a9ca53020c6938d",
                "label": "my_application",
                "name": "Netux | Cloud App of Me",
                "url": "https://api.netux.com/api/v2.0/apps/5dfa39901a9ca53020c6938d"
            },
            "createdAt": "2020-01-01T14:05:55.471155Z",
            "description": "Other Organization",
            "devicesCount": 0,
            "favicon":  {
        "h36": "https://.../media/logos/netux-white_36.png",
         "h50": "https://.../media/logos-big/netux-white_50.png",
         "raw": "https://.../media/logos-raw/netux-white.png"   
    },
            "id": "435ab418805c32fa400f",
            "isActive": true,
            "label": "my-second-customer",
            "limits": [
                {
                    "actual_value": 0,
                    "icon": "hdd-o",
                    "max_value": "*",
                    "name": "Devices",
                    "type": "devices"
                },
                {
                    "actual_value": 0,
                    "icon": "envelope",
                    "max_value": "*",
                    "name": "Emails",
                    "type": "emails"
                },
                {
                    "actual_value": 0,
                    "icon": "signal",
                    "max_value": "*",
                    "name": "Variables",
                    "type": "variables"
                },
                {
                    "actual_value": 0,
                    "icon": "users",
                    "max_value": "*",
                    "name": "Users",
                    "type": "users"
                },
                {
                    "actual_value": 0,
                    "icon": "spinner",
                    "max_value": "*",
                    "name": "Dots",
                    "type": "dots"
                },
                {
                    "actual_value": 0,
                    "icon": "mobile-phone",
                    "max_value": "*",
                    "name": "SMS",
                    "type": "sms"
                },
                {
                    "actual_value": 0,
                    "icon": null,
                    "max_value": "*",
                    "name": "Voice",
                    "type": "voice"
                }
            ],
            "logo": {
        "h36": "https://.../media/logos/netux-white_36.png",
        "h50": "https://.../media/logos-big/netux-white_50.png",
        "raw": "https://.../media/logos-raw/netux-white.png"
    },
            "name": "My Second Customer",
            "properties": {"color": "#BADA55"},
            "url": "https://api.netux.com/api/v2.0/organizations/435ab418805c32fa400f",
            "usersCount": 0
        }
    ]
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}