REST - Managing User Accounts, API Keys, and SSH Keys

Account Details

Request

GET /v2/account

Returns an array of user account details.

Response

{
   "success":true,
   "account":{
      "id":"$user_id",
      "name":"$user_name",
      "email":"$user_email",
      "phone":"$user_phone",
      "notification": {
         "email": "$notification_email",
         "phone": "$notification_phone"            
      },
      "e24files":
      {
         "s3":
         {
            "api_id":"$s3_api_key",
            "secret_key":"$s3_secret_key"
         },
         "swift":
         {
            "api_id":"$swift_api_key",
            "secret_key":"$swift_secret_key"
         }
      },
      "api":
      [
         {
            "api_key":"$api_key",
            "secret_key":"$api_secret_key"
         },
         {...}
      ],
      "sshkeys":
      [
         {
            "id":$ssh_id,
            "name":"$ssh_name",
            "fingerprint":"$ssh_fingerprint"
         },
         {...}
      ],
      "groups": 
      [
         {
            "id":$group_id,
            "name":"$group_name",
         },
         {...}
      ]
   }
}

Returned Information

  • $user_id (string) - UUID of the account owner
  • $user_name (string) - name of the account owner
  • $user_email (string) - email of the account owner
  • $user_phone (string) - phone number of the account owner
  • $notification_email (string) - email of the account owner for notifications
  • $notification_phone (string) - phone number of the account owner for notifications
  • $s3_api_key (string) - key for S3 connection
  • $s3_secret_key (string) - password for S3 connection
  • $swift_api_key (string) - key for Swift connection
  • $swift_secret_key (string) - password for Swift connection
  • $api_key (string) - API key
  • $api_secret_key (string) - API password
  • $ssh_id (int) - SSH key ID
  • $ssh_name (string) - name of the SSH key
  • $ssh_fingerprint (string) - fingerprint of the SSH key
  • $group_id (string) - ID of the user group
  • $group_name (string) - name of the user group


Changing Account Information

Request

POST /v2/account/data

Changes the information on the account.

Parameter Description

{ 
    "first_name": "$first_name", 
    "last_name": "$last_name", 
    "phone": "$phone",
    "password": "$password"
}

Parameters

  • $first_name (string) - First name of the account owner
  • $last_name (string) - Last name of the account owner
  • $phone (string) - Phone number of the account owner
  • $password (string) - New password for the account (optional field)

Response

{  
  "success":true
}


Adding a Key for EC2 and e24cloud API

Request

PUT /v2/account/api

Creates and returns the key and secret_key for the EC2 and e24cloud API.

Response

{
   "success":true,
   "api":
   {
        "api_key":"$api_key",
        "secret_key":"$api_secret_key"
   }
}

Returned Information

  • $api_key (string) - API key
  • $api_secret_key (string) - API password


Change secret-key for EC2 and e24cloud API

Request

POST /v2/account/api-new-secret-key

Generates and returns a new secret_key for EC2 and e24cloud API.

Request content

{ 
   "api_key":"$api_key",
}

Parameters

  • $api_key (string) - klucz API

Response

{
   "success":true,
   "api":
   {
        "api_key":"$api_key",
        "secret_key":"$api_secret_key"
   }
}

Returned Information

  • $api_key (string) - API key
  • $api_secret_key (string) - New API password


Deleting Key for EC2 and e24cloud API

Request

DELETE /v2/account/api

Deletes the key and password for EC2 and e24cloud API.

Request content

{ 
   "api_key":"$api_key",
}

Parameters

  • $api_key (string) - API key

Response

{
   "success":true
}


Adding SSH Key

Request

PUT /v2/account/sshkey

Adds or generates an SSH key.

Request content

{
    "name": "$ssh_name",
    "method": "$ssh_method",
    "content": "$ssh_key",
}

Parameters

  • $ssh_name (string) - API key
  • $ssh_method (string) - Takes one of two values:
    • generate - generates an SSH key
    • upload - allows us to upload an SSH key
  • $ssh_key (string) - If $ssh_method is set to upload, then the API requires that the SSH key be specified in this field.

Response

{
    "success":true,
    "sshkeys":
    {
        "id":$ssh_id,
        "name":"$ssh_name",
        "fingerprint":"$ssh_fingerprint"
    }
}

Returned Information

  • $ssh_id (int) - SSH key ID
  • $api_key (string) - API key
  • $api_secret_key (string) - New API password


Deleting SSH Key

Request

DELETE /v2/account/$SSH_ID/sshkey

Deletes the SSH key with the given $SSH_ID.

Response

{
   "success":true
}


New secret-key for e24files API

Request

POST /v2/account/files-new-secret-key

Generates and returns a new secret-key for the e24files API, compatible with both S3 and Swift.

Request content

{ 
   "api_key":"$api_key",
}

Parameters

  • $api_key (string) - API key

Response

{
    "success":true,
    "e24files":
    {
        "s3":
        {
            "api_id":"$s3_api_key",
            "secret_key":"$s3_secret_key"
        },
        "swift":
        {
            "api_id":"$swift_api_key",
            "secret_key":"$swift_secret_key"
        }
    }
}

Returned Information

  • $s3_api_key (string) - Key for S3 connection
  • $s3_secret_key (string) - Password for S3 connection
  • $swift_api_key (string) - Key for Swift connection
  • $swift_secret_key (string) - Password for Swift connection