Reseller API's Collection

The IDrive® e2 Reseller API is developed over REST architecture.

The IDrive® e2 Reseller API accepts request bodies in the form of content type 'application/JSON' and returns 'application/JSON' responses.

Our API uses API Key Authentication mechanism. You can generate the API key from the profile section of the IDrive® e2 account.

Add the API key generated from the profile section to all HTTP API calls header against key 'token'.

HTTP Response codes:

  • 200 (Success)
  • 500 (Server Error)
  • 400 (Invalid Parameters)
  • 401 (Unauthorized)
  • 403 (Invalid request)

The Error response body would be of following structure:

                        Response (application/JSON) : { 
      error : {
         string type;
         string code;
         string message;
       }
}

Possible values for 'error.type' are :

  1. api_error
  2. invalid_request_error
  3. server_error

For further details 'error.code' and 'error.message' would explain what went wrong.

Common Error Cases

Following are the common error cases that can be returned by all APIs detailed below. Rest of the error cases will be documented with the specific APIs.

  1. Server Error (HTTP 500)
     
                               Response (application/JSON) : {
          error:{
                type: 'api_error',
                code: 'request_processing_failed',
                message: 'Unable to process this request, please try again later'
                }
    }
  2. Unauthorized (HTTP 401)
     
                                  Response (application/JSON) : {
          error:{
                type: 'invalid_request_error',
                code: 'unauthorized',
                message: 'Authentication header missing/invalid'
           }
    }
  3. Invalid Parameters (HTTP 400)
     
                                  Response (application/JSON) : {
          error:{
                type: 'invalid_request_error',
                code: 'invalid_parameters',
                message: 'Invalid parameter values, check errors for details',
                errors: [] (array contain details of error)
             }
    }
AUTHORIZATION Header API Key
Key token
Value <YOUR-API-KEY>

Enumerations used throughout API's are:

Enums:

Access Key Permissions:

                        {
    0: Read access,
    1: Write access,
    2: Read/Write access
}

User Operations

  1. List all users

    GET
    https://api.idrivee2.com/api/reseller/v1/usersClick to copyLink copied This displays all the users added under your profile.

    Output

    API returns array of the users added under your profile.
    The structure of response is as following:

                               struct response {
            string id;
            List users[];
    }

    struct users{
            string email;
            string first_name;
            string last_name;
            string account_creation_timestamp;
            string invite_url;
            bool is_signed_up;
            bool is_active;
            double storage_used;
            int storage_quota;
    }
  2. Note:
    storage_used (bytes)
    storage_quota (GB's) (0 : unlimited else > 0)
    invite_url if not null can be used by the invited user to sign up

    Curl Example Request:

    curl --request GET 'https://api.idrivee2.com/api/reseller/v1/users' --header 'token: <your api key>'
  3. Create User
  4. PUT
    https://api.idrivee2.com/api/reseller/v1/create_userClick to copyLink copied This API will create a user account on IDrive® e2 which will be linked to your account.

    Input

                                  string email; 
    string password; //base64 encoded string
    string first_name;
    string last_name; //last_name is an optional parameter
    int quota;
    bool email_notification; //email_notification is an optional parameter

    Note:

    • Quota (GB's) (0 for unlimited else >0)
    • Password is a base64 encoded string.
    • email_notification Iff provided and set to false then no email notification would be send to the specified email address.

    Length Parameters

    • Email [255]
    • Password [100]
    • First Name [64]
    • Last Name [64]

    Output
    On Success API Response (application/JSON) would be :

    { user_created: true }

    Error Cases

    • Invalid Request (HTTP-403)
      1. User already exists and is linked to your account.
                                            { 
            error:{
                  type: 'invalid_request_error',
                  code: 'user_signed_up',
                  message : 'User already signed up'
                 }
        }
      2. Email already in use (an independent account exists which is not linked to your account).
                                               { 
            error:{
                  type: 'invalid_request_error',
                  code: 'email_already_in_use',
                  message: 'Email already in use'
                 }
        }

    Example Request :Body (application/JSON)

                                           {
        "email": "e2reseller+1@idrivee2.com",
        "password":"dGVzdDEyMw==",
        "first_name":"dev",
        "quota": 1024,
        "email_notification": false
    }

    Curl Example Request:

                                           curl  --request PUT 'https://api.idrivee2.com/api/reseller/v1/create_user' 
    --data '{
        "email": "e2reseller+1@idrivee2.com",
        "password":"dGVzdDEyMw==",
        "first_name":"dev",
        "quota": 1024
    }' --header 'token: <your api key>'
  5. Disable User
  6. POST
    https://api.idrivee2.com/api/reseller/v1/disable_userClick to copyLink copied This API disables the user account. Users will not be able to login, access data, and perform any operations.

    Input

    string email;

    Length Parameters

    • Email [255]

    Precondition

    • User signed up.
    • Account enabled.

    Output
    On Success API Response (application/JSON) would be :

    { user_disabled : true }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account already disabled.
                                                           error:{ 
               type: 'invalid_request_error',
               code: 'user_account_already_disabled',
               message: 'Account already disabled for the user'
               }
        }
      2. Account does not exist.
                                                        error:{ 
               type: 'invalid_request_error',
               code: 'account_non_existant',
               message: 'Account with this email does not exist'
               }
        }

    Example Request :Body (application/JSON)

                                           {
        "email":"e2reseller+1"
    }

    Curl Example Request:

                                           curl --request POST 'https://api.idrivee2.com/api/reseller/v1/disable_user' 
    --data '{
        "email":"e2reseller+1@idrivee2.com"
    }'
  7. Enable User
  8. POST
    https://api.idrivee2.com/api/reseller/v1/enable_userClick to copyLink copied This API reenables disabled user accounts. Users can login, access data, and perform normal operations.

    Input

    string email;

    Length Parameters

    • Email [255]

    Precondition

    • User signed up/created.
    • User account was disabled previously.

    Output
    On Success API Response(application/JSON) would be:

    { user_enabled : true }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                                           error:{ 
               type: 'invalid_request_error',
               code: 'account_non_existant',
               message: 'Account with this email does not exist'
               }
        }
      2. Account already enabled.
                                                        error:{ 
               type: 'invalid_request_error',
               code: 'user_account_already_enabled',
               message: 'Account already enabled for the user'
               }
        }

    Example Request :Body (application/JSON)

                                          {
        "email":"e2reseller+1"
    }

    Curl Example Request:

                                           curl  --request POST 'https://api.idrivee2.com/api/reseller/v1/enable_user' 
    --data '{
        "email":"e2reseller+1@idrivee2.com"
    }' --header 'token: <your api key>'
  9. Remove User
  10. POST
    https://api.idrivee2.com/api/reseller/v1/remove_userClick to copyLink copied This API will permanently delete users from IDrive® e2.

    Note: The user data will be lost permanently on performing this operation.

    Input

    string email;

    Length Parameters

    • Email [255]

    Precondition

    • User must be disabled.

    Output
    On success API Response(JSON) would be :

    { user_removed : true }
    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                                           {
              error:{
                     type: 'invalid_request_error',
                     code: 'account_non_existant',
                     message:'Account with this email does not exist'
                    }
        }
      2. Account not disabled.
                                                              {
              error:{
                     type: 'invalid_request_error',
                     code: 'user_account_not_disabled',
                     message: 'User account not disabled'
                    }
        }

    Example Request :Body (application/JSON)

                                             {
        "email":"e2reseller+1"
    }

    Curl Example Request:

                                              curl  --request POST 'https://api.idrivee2.com/api/reseller/v1/remove_user' 
    --data '{
        "email":"e2reseller+1"
    }' --header 'token: <your api key>'
  11. Get Storage Usage
  12. POST
    https://api.idrivee2.com/api/reseller/v1/usage_statsClick to copyLink copied This API returns the array of IDrive® e2 utilization for the user provided.

    Input

                                              {
        string email;
        string date_from;
        string date_to;
    }

    date_from(ISO8601)(start date)
    date_to(ISO8601) (end date)
    Length Parameters

    • Email [255]

    Preconditions

    • User must be signed up.

    Output
    Array of usage_stats structure

                                                 struct usage_stats{ 
           double downloads;
           double uploads;
           double disk_used;
           string date;
    }

    downloads, uploads, disk_used are in bytes
    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                                              {
             error:{
                   type: 'invalid_request_error',
                   code: 'account_non_existant',
                   message: 'Account with this email does not exist'
                  }
        }

    Example Request :Body (application/JSON)

                                                {
        "email":"e2reseller+1",
        "date_to":"2022-08-31",
        "date_from":"2022-08-01"
    }

    Curl Example Request:

                                                 curl  --request POST 'https://api.idrivee2.com/api/reseller/v1/usage_stats' 
    --data '{
        "email": "DEV-TEST+1@idrivee2.com",
        "date_to":"2022-08-31",
        "date_from":"2022-08-01"
    }' --header 'token: <your api key>'

Storage Operations

  1. List Regions

    GET
    https://api.idrivee2.com/api/reseller/v1/regionsClick to copyLink copied This API returns an array of regions for IDrive® e2.

    Output

    struct regions{ 
            string region_key;
            string region_name;
            string country;
            string region_code;
            bool active;
            bool hdd_storage;
            bool ssd_storage;
    }

    Note: Only active regions can be enabled for the user.

    Example Request: List Regions

    curl --request GET 'https://api.idrivee2.com/api/reseller/v1/regions' --header 'token: <your api key>'
                                     
                                  
  2. Enable Region for User
  3. POST
    https://api.idrivee2.com/api/reseller/v1/enable_user_regionClick to copyLink copied This API enables the regions for the user.

    Input

    {
         string email;
         string region;
         bool ssd_storage; // ssd_storage is an optional parameter;
    }

    region : region_key from list regions api. e.g "TX", "LDN" etc.

    ssd_storage : set true to use SSD Storage for a specified region. SSD Storage availability for regions can be identified on ssd_storage from list regions api.

    API returns the storage DN (domain name) for the enabled region through which user storage can be accessed using access key and secret key.

    Length Parameters

    • Email [255]
    • Region[5]

    Precondition

    • Existing user account.
    • Region must not be enabled for the user.
    • Region must have an SSD Storage to set 'ssd_storage' as true.

    Output

    On Success API Response(application/JSON) would be :

    { storage_added: true, storage_dn: /*user_storage_dns*/ }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                               {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. Storage region already enabled for the user.
                                               {
            error:{
                  type: 'invalid_request_error',
                  code: 'region_already_enabled',
                  message: 'Storage region already enabled for user'
            }
        }
      3. User disabled.
                                               {
            error:{
                  type: 'invalid_request_error',
                  code: 'user_disabled',
                  message: 'User Disabled'
            }
        }
      4. Payment for your account failed.
                                               {
            error:{
                  type: 'invalid_request_error',
                  code: 'payment_failed',
                  message: 'Account expired please update payment info'
            }
        }

    Example Request :Body (application/JSON)

                               {
        "email":"e2reseller+1",
        "region": "NY"
    }

    Curl Example Request:

                                curl  --request POST 'https://api.idrivee2.com/api/reseller/v1/enable_user_region'
    --data '{
      "email":"e2reseller+1",
      "region": "NY"
    }' --header 'token: <your api key>'
  4. List User Enabled Regions

    POST
    https://api.idrivee2.com/api/reseller/v1/list_user_regionsClick to copyLink copied This API lists all enabled regions of the user.

    Input

    {
                                       
    string email;
    }

    Length Parameters

    • Email [255]

    Precondition

    • Existing user account.

    Output

    On Success API Response(application/JSON) would be :

                                     { 
      user_regions: /*lists user enabled regions*/
    }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                                  {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. User disabled..
                                                  {
            error:{
                  type: 'invalid_request_error',
                  code: 'user_disabled',
                  message: 'User Disabled'
            }
        }

    Example Request :Body (application/JSON)

                                        {
      "email":""
    }

    Curl Example Request:

    curl --request POST 'https://api.idrivee2.com/api/reseller/v1/list_user_regions'
    --data '{
    "email":""
    }' --header 'token: <your api key>'
  5. Remove Region assigned to User
  6. POST
    https://api.idrivee2.com/api/reseller/v1/remove_user_regionClick to copyLink copied This API removes a region assigned to the user.

    Input

    { 
        string email;
        string storage_dn;
    }

    'storage_dn' is the storage domain assigned to the user you wish to be removed.

    Length Parameters

    • Email [255]
    • Storage_dn[128]

    Precondition

    • User signed up.
    • Storage should be assigned to the user.

    Please note this action will result in deletion of the user data.

    API will allow you to remove user region if

    User is in disabled state

    1. No bucket created by the user

    Output

    On Success API will return Response (JSON) :

    {removed : true}

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                                  {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. Storage does not exist.
                                                  {
            error:{
                  type: 'invalid_request_error',
                  code: 'storage_non_existant',
                  message: 'Storage does not exists'
            }
        }
      3. Storage not empty.
                                                  {
            error:{
                  type: 'invalid_request_error',
                  code: 'storage_not_empty',
                  message: 'Storage not empty. To avoid user data loss, this request will not be
                  processed. To remove this storage, please disable the user first and try again'
            }
        }

    Example Request :Body (application/JSON)

                                  {
        "email":"e2reseller+1",
        "storage_dn": "abcd.test@idrivee2.com"
    }

    Curl Example Request:

    							  curl  --request POST 'https://api.idrivee2.com/api/reseller/v1/remove_user_region'
    --data '{
       "email":"e2reseller+1",
       "storage_dn": "abcd.test@idrivee2.com"
    }' --header 'token: <your api key>'
  7. Add Access Key
  8. POST
    https://api.idrivee2.com/api/reseller/v1/create_access_keyClick to copyLink copied This API creates an Access Key for storage access and returns the Access Key ID and Secret Key.

    Input

    { 
        string email;
        string storage_dn;
        string name;
        int permissions;
        array buckets; //buckets is an optional parameter
    }

    Buckets: Provide a list of bucket names to create an access key for specified buckets to access storage. 'buckets' input is not required if access key is for all buckets.

    Precondition

    • User signed up/created and enabled.
    • Storage DN assigned to the respective user.
    • Buckets should not be empty if provided.

    Length Parameters

    • Email [255]
    • storage_dn[128]
    • Name[64]

    Access Key Permissions Enumeration:

    { 
        0: Read access
        1: Write access
        2: Read/Write access
    }

    Output

    On Success API would return Response (application/JSON):

                                  {
    created: true,
            data: {
                    access_key: /access key/
                    secret_key: /* secret key*/
            }
    }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                               {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. Storage does not exist.
                                               {
            error:{
                  type: 'invalid_request_error',
                  code: 'storage_non_existant',
                  message: 'Storage does not exists'
            }
        }
      3. User disabled.
                                               {
            error:{
                  type: 'invalid_request_error',
                  code: 'user_disabled',
                  message: 'User Disabled'
            }
        }

    Example Request :Body (application/JSON)

                               {
        "email":"e2reseller+1",
        "storage_dn":"abcd.test@idrivee2.com",
        "name":"myaccesskeyname",
        "permissions":0
    }

    Curl Example Request:

                                curl  --request POST 'https://api.idrivee2.com/api/reseller/v1/create_access_key'
    --data '{
       "email":"e2reseller+1",
       "storage_dn":"abcd.test@idrivee2.com",
       "name":"myaccesskeyname",
       "permissions":0
    }' --header 'token: <your api key>'
  9. List Access Keys
  10. POST
    https://api.idrivee2.com/api/reseller/v1/list_access_keysClick to copyLink copied This API lists all the Access Keys for the storage.

    Input

    { 
        string email;
        string storage_dn;
    }

    'storage_dn' is the storage domain assigned to the user of which you wish to list all access keys

    Length Parameters

    • email [255]
    • storage_dn[128]

    Precondition

    • User signed up/created and enabled.
    • Storage assigned to the user.

    Output

    On Success API would return Response(application/JSON) :

                                  {
      'storage_dn' : /*user_storage_dns*/,
      'access_keys' : [
          {
            'key_id' : /*key_id*/,
            'name' : /*key_name*/,
            'creation_date' : /*date_of_key_creation*/,
            'description' : /*description_of_access_key_permissions*/
          },
          {...},
          …
        ]
    }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                            {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. Storage does not exist.
                                            {
            error:{
                  type: 'invalid_request_error',
                  code: 'storage_non_existant',
                  message: 'Storage does not exist'
            }
        }
      3. User disabled.
                                            {
            error:{
                  type: 'invalid_request_error',
                  code: 'user_disabled',
                  message: 'User Disabled '
            }
        }

    Example Request : Body (application/JSON)

                               {
        "email" : "e2reseller+1@idrivee2.com",
        "storage_dn" : "abcd.test.idrivee2.com"
    }

    Curl Example Request:

                             curl --request POST 'https://api.idrivee2.com/api/reseller/v1/list_access_keys'
    --data '{
        "email":"e2reseller+1",
        "storage_dn":"abcd.test.idrivee2.com",
    }' --header 'token:<your api key>'
  11. Remove Access Key
  12. POST
    https://api.idrivee2.com/api/reseller/v1/remove_access_keyClick to copyLink copied This API removes the Access Key for the storage.

    Input

    { 
        string email;
        string storage_dn;
        string access_key;
    }

    Length Parameters

    • Email [255]
    • storage_dn[128]
    • access_key[128]

    Precondition

    • User signed up/created and enabled.
    • Storage assigned to user.
    • access key exists for the storage.

    Output

    On Success API would return Response(application/JSON) :

    {removed : true}

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. Storage does not exist.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'storage_non_existant',
                  message: 'Storage does not exists'
            }
        }
      3. User disabled.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'user_disabled',
                  message: 'User Disabled'
            }
        }
      4. Access key does not exist.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'access_key_non_existant',
                  message: 'Access key does not exist, please provide a valid access key'
            }
        }

    Example Request :Body (application/JSON)

                         {
        "email":"e2reseller+1",
        "storage_dn":"abcd.test@idrivee2.com",
        "access_key":"<ACCESS-KEY-ID>"
    }

    Curl Example Request:

                          curl --location --request POST 'https://api.idrivee2.com/api/reseller/v1/remove_access_key'
    --data '{
        "email":"e2reseller+1",
        "storage_dn":"abcd.test@idrivee2.com",
        "access_key":"<your access key>"
    }' --header 'token: <your api key>'

Whitelabeling Operations

  1. Add CNAMEs

    POST
    https://api.idrivee2.com/api/reseller/v1/storage/cname/addClick to copyLink copied This API adds Cname for the specified storage dns.

    Input

    { 
        string email;
        string storage_dn;
        string cname;
        string public_key;
        string private_key;
        string file_index;
    }

    'storage_dn' is the storage domain assigned to the user.

    'cname' is the new cname needs to be assigned.

    'file_index' is an optional parameter.

    Length Parameters

    • email[255]
    • storage_dn[128]
    • cname[128]
    • public_key[10000]
    • private_key[6000]
    • file_index[64]

    Precondition

    • User signed up/created and enabled.
    • Storage assigned to the user.

    Output

    On Success API would return Response(application/JSON) :

    { 'cname_added' : true }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. CNAME cannot be used
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'this CNAME cannot be used, please try changing your CNAME'
            }
        }
      3. Storage Domain does not existIf storage_ dns is wrong
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'Unable to retrieve storage info for given storage_dn'
            }
        }
      4. If CNAMEcname already configured
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'CNAME already configure'
            }
        }
      5. Invalid CNAME or CertificatesIf public private keys are wrong
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'Could not verify CNAME or certificates. Please try again'
            }
        }
    • Server Error (HTTP 500)
      1. Unable to process this request
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'Unable to process this request, please try again later'
            }
        }
      2. Data not found for given dns
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'data not found for given dns'
            }
        }

    Example Request : Body (application/JSON)

    { 
        "email": "e2reseller+1@idrivee2.com",
        "storage_dn": "abcd.test.idrivee2.com",
        "cname" : "example.mycloud.io",
        "public_key" : "...",
        "private_key" : "...",
        "file_index" : "1"
    }

    Curl Example Request:

    curl --request POST 'https://api.idrivee2.com/api/reseller/v1/storage/cname'
    --data'{
        "email": "e2reseller+1@idrivee2.com",
        "storage_dn": "abcd.test.idrivee2.com",
        "cname" : "example.mycloud.io",
        "public_key" : "...",
        "private_key" : "...",
        "file_index" : "1"
    }'--header 'token:<your api key>'
  2. List CNAMEs

    POST
    https://api.idrivee2.com/api/reseller/v1/storage/cnameClick to copyLink copied This API lists all the Cnames for the storage.

    Input

    { 
        string email;
        string storage_dn;
    }

    'storage_dn' is the storage domain assigned to the user of which you wish to list all CNAMEs

    Length Parameters

    • email[255]
    • storage_dn[128]

    Precondition

    • User signed up/created and enabled.
    • Storage assigned to the user.

    Output

    On Success API would return Response(application/JSON) :

    {
        'cname_list' : [
             {
                  file_index: /*file_index*/,
                  cname: /*cname*/,
                  certificate_info: /*isValidSsl.certInfo*/
                  creation_date: /*creation_date*/
             }

             {...},
         ]
    }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. User disabled.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'user_disabled',
                  message: 'User Disabled'
            }
        }
    • Server Error (HTTP 500)
      1. Unable to process this request
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'Unable to process this request, please try again later'
            }
        }
      2. Data not found for given dns
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'data not found for given dns'
            }
        }

    Example Request : Body (application/JSON)

    { 
        "email": "e2reseller+1@idrivee2.com",
        "storage_dn": "abcd.test.idrivee2.com",
    }

    Curl Example Request:

    curl --request POST 'https://api.idrivee2.com/api/reseller/v1/storage/cname'
    --data'{
        email: "e2reseller+1@idrivee2.com",
        storage_dn: abcd.test.idrivee2.com,
    }'--header 'token:<your api key>'
  3. Update CNAMEs

    POST
    https://api.idrivee2.com/api/reseller/v1/remove_access_keyClick to copyLink copied This API updates Cname for the specified storage dns.

    Input

    { 
        string region_key;
        string email;
        string storage_dn;
        string cname;
        string public_key;
        string private_key;
        string file_index;
    }

    'storage_dn' is the storage domain assigned to the user.

    'cname' is the new cname that needs to be replaced with the already existing cname.

    'file_index is an optional parameter.

    Length Parameters

    • email[255]
    • storage_dn[128]
    • cname[128]
    • public_key[10000]
    • private_key[6000]
    • file_index[64]

    Precondition

    • User signed up/created and enabled.
    • Storage assigned to the user.

    Output

    On Success API would return Response(application/JSON) :

    { 'cname_updated' : true }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. CNAME cannot be usedIf cname is idrive domain
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'this CNAME cannot be used, please try changing your CNAME'
            }
        }
      3. Storage Domain does not existIf storage_ dns is wrong
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'Unable to retrieve storage info for given storage_dn'
            }
        }
      4. If storage_dn is wrong
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'Unable to retrieve storage info for given storage_dn'
            }
        }
      5. Storage server cannot be reachedDomain does not existIf storage _dns is unavailable
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'Storage server cannot be reached right now, please try again later'
            }
        }
      6. If CNAMEcname already configured
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'CNAME already configured'
            }
        }
      7. Invalid CNAME or CertificatesIf public private keys are wrong
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'Could not verify CNAME or certificates. Please try again'
            }
        }
      8. User disabled
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'user_disabled',
                  message: 'User Disabled'
            }
        }
    • Server Error (HTTP 500)
      1. Unable to process this request
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'Unable to process this request, please try again later'
            }
        }
      2. Data not found for given dns
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'data not found for given dns'
            }
        }

    Example Request : Body (application/JSON)

    { 
        "email": "e2reseller+1@idrivee2.com",
        "storage_dn": "abcd.test.idrivee2.com",
        "cname" : "example.mycloud.io",
        "public_key" : "...",
        "private_key" : "...",
        "file_index" : "1"
    }

    Curl Example Request:

    curl --request POST 'https://api.idrivee2.com/api/reseller/v1/storage/cname/update
    --data'{
        "email": "e2reseller+1@idrivee2.com",
        "storage_dn": "abcd.test.idrivee2.com",
        "cname" : "example.mycloud.io",
        "public_key" : "...",
        "private_key" : "...",
        "file_index" : "1"
    }'--header 'token:<your api key>'
  4. Remove CNAMEs

    POST
    https://api.idrivee2.com/api/reseller/v1/storage/cname/removeClick to copyLink copied This API removes CNAME for the storage dns.

    Input

    { 
        string email;
        string storage_dn;
        string cname;
    }

    'storage_dn' is the storage domain assigned to the user.

    cname: provide cname which needs to be removed.

    Length Parameters

    • email[255]
    • storage_dn[128]
    • cname[128]

    Precondition

    • User signed up/created and enabled.
    • Storage assigned to the user.
    • Cname should be mapped to the storage domain.

    Output

    On Success API would return Response(application/JSON) :

    { 'cname_removed' : true }

    Error Cases

    • Invalid Request (HTTP 403)
      1. Account does not exist.
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'account_non_existant',
                  message: 'Account with this email does not exist'
            }
        }
      2. User disabled
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'user_disabled',
                  message: 'User Disabled'
            }
        }
      3. CNAME cannot be used
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'this CNAME cannot be used, please try changing your CNAME'
            }
        }
      4. Storage Domain does not exist
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'Unable to retrieve storage info for given storage_dn'
            }
        }
      5. Storage server cannot be reached
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'Storage server cannot be reached right now, please try again later'
            }
        }
      6. CNAME does not exist for the storage domain
                                         {
            error:{
                  type: 'invalid_request_error',
                  code: 'request_processing_failed',
                  message: 'cannot get cname details'
            }
        }
      7. Failed to remove CNAMECannot remove Cname
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'Unable to process this request, please try again later'
            }
        }
    • Server Error (HTTP 500)
      1. Unable to process this request
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'Unable to process this request, please try again later'
            }
        }
      2. Data not found for given dns
                                         {
            error:{
                  type: 'api_error',
                  code: 'request_processing_failed',
                  message: 'data not found for given dns'
            }
        }

    Example Request : Body (application/JSON)

    { 
        "email": "e2reseller+1@idrivee2.com",
        "storage_dn": "abcd.test.idrivee2.com",
        "cname" : "example.mycloud.io"
    }

    Curl Example Request:

    curl --request POST 'https://api.idrivee2.com/api/reseller/v1/storage/cname/remove
    --data'{
        "email": "e2reseller+1@idrivee2.com",
        "storage_dn": "abcd.test.idrivee2.com",
        "cname" : "example.mycloud.io"
    }'--header 'token:<your api key>'