Дерево страниц
Перейти к концу метаданных
Переход к началу метаданных

Hc_sp_api_login

Команда регистрации пользователя в портале абонента по домену, логину, паролю.

Аналога команды в CoCon нет.

Метод http запроса:

POST

Шаблон HTTP-запроса:

http://server:9999/commands/sp_login

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="login" type="xs:string" use="required"/>
        <xs:attribute name="password" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
            <xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="okType">
        <xs:attribute name="session" type="xs:string" use="required"/>
        <xs:attribute name="alias_address" type="xs:string"/>
        <xs:attribute name="alias_iface" type="xs:string"/>
    </xs:complexType>

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" type="requestType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

</xs:schema>

Пример: 

Запрос: http://192.168.1.21:9999/commands/sp_login

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sp_api_login.xsd">
    <request domain="biysk.local" login="240101" password="ssw_101" />
</in>

Ответ:200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_login.xsd">
    <response>
        <ok session="b642dd1dd8500124fc4593ebfb3636d1daddbdfa" alias_iface="062743c4240eae38" alias_address="240101"/>
    </response>
</out>

Если пользователя с указанной парой логин/пароль не существует:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_login.xsd">
    <response>
        <error description="invalid pair login/password"/>
    </response>
</out>

Hc_sp_api_logout

Команда позволяет по указанному идентификатору завершить сессию с "Порталом абонента" в определенном домене.

Аналога команды в CoCon нет.

Метод http запроса:

POST

Шаблон HTTP-запроса:

http://server:9999/commands/sp_logout

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="session" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
            <xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="okType" />

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" type="requestType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

</xs:schema>

Пример: 

Запрос: http://192.168.1.21:9999/commands/sp_logout

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sp_api_logout.xsd">
    <request domain="biysk.local" session="b642dd1dd8500124fc4593ebfb3636d1daddbdfa" />
</in>

Ответ: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_logout.xsd">
    <response>
        <ok/>
    </response>
</out>

Hc_sp_api_change_login

Команда позволяет по указанному логину пользователя "Портала абонента" сменить его на новый в определенном домене

Аналог команды в CoCon:

/domain/<DOMAIN>/alias/set

Метод http запроса:

POST

Шаблон HTTP-запроса:

http://server:9999/commands/sp_change_login

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="oldlogin" type="xs:string" use="required"/>
        <xs:attribute name="newlogin" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
            <xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="okType" />

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" type="requestType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

</xs:schema>

Пример: 

 Запрос:

 http://192.168.1.21:9999/commands/sp_change_login

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sp_api_change_login.xsd">
    <request domain="biysk.local" oldlogin="240101" newlogin="240101_ssw" />
</in>

Ответ: 200

Успешная замена логина:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_change_login.xsd">
    <response>
        <ok/>
    </response>
</out>

Если пользователя с указанным логином не существует:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_change_login.xsd">
    <response>
        <error description="not_exists"/>
    </response>
</out>

Hc_sp_api_change_password

Команда позволяет по указанному логину пользователя "Портала абонента" сменить пароль на новый в определенном домене

Аналог команды в CoCon:

/domain/<DOMAIN>/alias/set

Шаблон HTTP-запроса:

http://server:9999/commands/sp_change_password

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="login" type="xs:string" use="required"/>
        <xs:attribute name="newpassword" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
            <xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="okType" />

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" type="requestType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

</xs:schema>

Пример: 

Запрос: http://192.168.1.21:9999/commands/sp_change_password

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sp_api_change_password.xsd">
    <request domain="biysk.local" login="240466_123" newpassword="456" />
</in>

Ответ: 200

Успешная смена пароля:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_change_password.xsd">
    <response>
        <ok/>
    </response>
</out>

Если пользователя с указанным логином не существует:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_change_password.xsd">
    <response>
        <error description="not_exists"/>
    </response>
</out>

Hc_sp_api_check_login

Команда позволяет проверить свободен ли указанный логин для "Портала абонента" в определенном домене

Аналога команды в CoCon нет.

Шаблон HTTP-запроса:

http://server:9999/commands/sp_check_login

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="login" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
            <xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="okType" />

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" type="requestType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

</xs:schema>

Пример: 

Запрос: http://192.168.1.21:9999/commands/sp_check_login

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sp_api_check_login.xsd">
    <request domain="biysk.local" login="240466" />
</in>

Ответ: 200

Если не существует пользователя с указанным логином.

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_check_login.xsd">
    <response>
        <ok/>
    </response>
</out>

Если существует пользователь с указанным логином.

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_check_login.xsd">
    <response>
        <error description="already_exists"/>
    </response>
</out>

Hc_sp_api_check_session

Команда позволяет проверить по указанному идентификатору и логину существует ли сессия с "Порталом абонента" в определенном домене

Аналога команды в CoCon нет.

Шаблон HTTP-запроса:

http://server:9999/commands/sp_check_session

Коды ответа:

  • 200 - в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="login" type="xs:string" use="required"/>
        <xs:attribute name="session" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
            <xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="okType" />

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" type="requestType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>

</xs:schema>

Пример: 

Запрос: http://192.168.1.21:9999/commands/sp_check_session

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="sp_api_check_session.xsd">
    <request domain="biysk.local" login="Login" session="7e67399706f6b734ec7806cacca9ee9ffe2e2845" />
</in>

Ответ: 200

Если сессия существует:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_check_session.xsd">
    <response>
        <ok/>
    </response>
</out>

Если сессия не существует:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sp_api_check_session.xsd">
    <response>
        <error description="not_exists"/>
    </response>
</out>
  • Нет меток
Написать комментарий...