Quick Reference

Quickstart.Authentication

Estimated reading: 3 minutes 684 views

Signin (session,[appid], login, password ) :

Creates a session for the specified user to authenticate different actions within the account. This session is valid until the Signout method is called or session has been expired.

URL

https://[hoster-api-host]/1.0/users/authentication/rest/signin

Parameters

  • session : “string”
  • appid : “string” (optional)
    unique identifier of the target application (required for authentication).
  • login : “string”
    email address or unique identifier of the target user.
  • password : “string”
    password for authenticating the target user.

Example

Method: POST POST https://[hoster-api-host]/1.0/users/authentication/rest/signin?password=[string]&appid=[string]&login=[string]

Response

stdClass Object
(
    [result] => 0
    [accessType] => "FULL_ACCESS(0) | RESTRICTED(1)"
    [uid] => "int"
    [debug] => stdClass Object
        (
            [cpu] => stdClass Object
                (
                    [usage] => 0
                    [time] => 0
                )
            [time] => "int"
        )
    [data] => stdClass Object
        (
            [lang] => "string"
        )
    [authConfig] => stdClass Object
        (
            [type] => "string"
        )
    [session] => "string"
    [email] => "string"
    [status] => "ENABLED(0) | SUSPENDED(1)"
)

CreateToken (session, [password], description, [tokenTemplate], [apiList], [expiresAt] ) :

Creates a personal access token, which allows executing specific API methods.

URL

https://[hoster-api-host]/1.0/users/authentication/rest/createtoken

Request Parameters

  • session : “string”
  • password : “string”
    password for authenticating the current user.
  • description : “string”
    custom description for the created token.
  • tokenTemplate : “string”
    one of standard tokens configurations with the predefined permissions (Marketplace, Maven Plugin, IDE Plugins, Extended Access). You can get the full list with the “GetTokenTemplates” method. If not specified, a “Custom” token with manually provided “apiList” will be created.
  • apiList : “string”
    a comma-separated list of API methods that are allowed by the token. You can get the full list with the “GetTokenApiList” method. For example: [“env.control.CreateEnvironment”, “env.control.RedeployContainersByGroup”, “env.file.AddMountPointByGroup”].
  • expiresAt : “string” (optional)
    expiration date (UTC) for the token. In the format “yyyy-MM-dd hh:mm:ss”, e.g. “2022-11-16 00:00:00”.

Example

Method: POST https://[hoster-api-host]/1.0/users/authentication/rest/createtoken?tokenTemplate=[string]&password=[string]&session=[string]&description=[string]&expiresAt=[string]&apiList=[string]

Response

stdClass Object
(
    [result] => 0
    [debug] => stdClass Object
        (
            [cpu] => stdClass Object
                (
                    [usage] => 0
                    [time] => 0
                )
            [time] => "int"
        )
    [token] => stdClass Object
        (
            [tokenTemplate] => "string"
            [description] => "string"
            [id] => "int"
            [createdOn] => "Timestamp"
            [key] => "string"
            [apiList] => Array
                (
                    [0] => "API1",
                    [1] => "API2",
                )
        )
)

GetUserInfo (appid, session ) : 

Returns user information for the specified account.

URL

https://[hoster-api-host]/1.0/users/account/rest/getuserinfo

Parameters

Example

Method: POST

https://[hoster-api-host]/1.0/users/account/rest/getuserinfo?session=[string]&appid=[string]

Response

  • AuthenticationResponse
    {
       "result": "int",
       "accessType": "FULL_ACCESS(0) | RESTRICTED(1)",
       "uid": "int",
       "debug": {
           "cpu": {
               "usage": "string",
               "time": "int"
           },
           "time": "int"
       },
       "data": {
           "lang": "string"
       },
       "authConfig": {
           "type": "string"
       },
       "email": "string",
       "status": "ENABLED(0) | SUSPENDED(1)",
    }
    

Leave a Comment