use_auth_hash

To log in with an authorization hash, use the core/use_auth_hash method. Get the hash with the core/create_auth_hash method and specify it in the authHash parameter. You can use this method instead of core/duplicate.

Endpoint

Copied!
svc=core/use_auth_hash&params={
  "authHash": <text>,
  "operateAs": <text>,
  "appName": <text>,
  "checkService": <text>
}

Parameters

The authHash parameter is required. The other parameters are optional.

Parameter Description
authHash The authorization hash that you can get using the core/create_auth_hash method.
operateAs The name of the subordinate user on whose behalf you want to log in. You should have the Act on behalf of this user access right to this user.
appName The name of the app. It’s written to the server logs.
checkService The name of the service to check in the user’s billing plan. You can get the list of services using the account/get_account_data method (see the Services list section).

Response

If the request is completed successfully, a response of the following format is returned:

Copied!
{
    "eid": <text>,                  /* Session ID. */
    "gis_sid": <text>,              /* Session ID for the GIS services. */
    "host": <text>,                 /* Host. */
    "hw_gw_ip": <text>,             /* IP address of the server to which devices send data. */
    "au": <text>,                   /* Username. */
    "hl": <int>,                    /* Have login ID. True if the field is present (the value is always 1). */
    "tm": <uint>,                   /* Current time (UTC). */
    "wsdk_version": <text>,         /* SDK version. */
    "base_url": <text>,
    "hw_gw_dns": <text>,            /* Domain name of the server to which devices send data. */
    "gis_search": <text>,           /* GIS search URL. */
    "gis_render": <text>,           /* GIS render URL. */
    "gis_geocode": <text>,          /* GIS geocode URL. */
    "gis_routing": <text>,          /* GIS routing URL. */
    "token": <text>,                /* Session token. */
    "th": <text>,                   /* Token hash. */
    "web_site": <text>,             /* URL of the Wialon monitoring system. */
    "web_cms_manager_site": <text>, /* URL of the Wialon management system. */
    "user": {                       /* The user on whose behalf you want to log in. */
        "nm": <text>,               /* Name. */
        "cls": <uint>,              /* ID of the superclass "user". */
        "id": <long>,               /* ID. */
        "prp": {                    /* Custom properties, for example: */
            "dst": <text>,          /* Daylight saving time. */
            "language": <text>,     /* Language (two-letter code). */
            "msakey": <text>,       /* Access key to the mobile site. */
            "pcal": <text>,         /* Iranian calendar. */
            "tz": <text>,           /* Time zone. */
            "us_units": <text>,     /* US metrics (miles and gallons). */
            ...
        },
        "crt": <uint>,              /* Creator ID. */
        "bact": <uint>,             /* Account ID. */
        "fl": <uint>,               /* User flags. */
        "hm": <text>,               /* Host mask. */
        "uacl": <uint>,             /* User access to himself. */
        "mu": <uint>,               /* Measurement system. */
        "ct": <uint>,               /* User creation date. */
        "ftp": {<text>},            /* FTP server settings. */
        "ld": <uint>,               /* Date of the previous login. */
        "pfl": <uint>,              /* Creator flag. */
        "ap": {                     /* Two-factor authentication settings. */
            "type": <uint>,         /* Authentication type (0 — none, 1 — email, 2 — SMS). */
            "phone": <text>         /* Phone number. */
        },
        "mapps": {<text>},          /* List of mobile apps. */
        "mappsmax": <int>           /* Restrictions for the mobile apps specified in the billing plan. */
    },
    "classes": {                    /* Superclasses available to the current user (key — superclass name, value — superclass ID): */
        "avl_hw": <uint>,           /* Hardware type. */
        "avl_resource": <uint>,     /* Resource. */
        "avl_retranslator": <uint>, /* Retranslator. */
        "avl_unit": <uint>,         /* Unit. */
        "avl_unit_group": <uint>,   /* Unit group. */
        "user": <uint>,             /* User. */
        "avl_route": <uint>         /* Route. */
    },
    "features": {
        "unlim": <bool>,            /* Billing plan type: 0 — regular, 1 — special (for development/testing). */
        "svcs": {                   /* Hash collection of allowed services; if a service isn't mentioned here, it is forbidden. */
            "<service_name>": <bool>, /* Key — service name; value: 0 — service available, but limit reached, 1 — service available and can be used. */
            ...
        }
    }
}

The user flags are described on the update_user_flags page.

See more about the FTP settings on the update_ftp_property page.

If the request fails, an error code is returned.

Error codes

Error code Description
4 Wrong input parameters.
6 Internal server error.
7 Access denied.
8 Login failed.
1003 See the reason field for details.

If you find a mistake in the text, please select it and press Ctrl+Enter.