REST API:tenant Resource

REST API:tenant Resource

From LongJump Support Wiki

REST API:tenant Resource
Jump to: navigation, search

Performs actions on Tenant records via the REST API

Contents

Access Permissions

File:Lock-tiny.gif

Users that have the Manage Tenants and Company Capabilities permission can use this REST API resource. 


Retrieve the metadata for a Tenant

Retrieves metadata for a Tenant via the REST API

Method
GET
URI
https://na.longjump.com/networking/rest/tenant/{tenant_id}
Response
<platform>
    <tenant>
        <id>1479765335</id>
        <object_id>8c5b349851c041a28d19277a12dee8f0</object_id>
        <document_space/>
        <classification/>
        <partner type=""
           uri="https://{domain}/networking/rest/tenant/1384998015"
           displayValue="MSP 15">1384998015</partner>
        <trial_days/>
        <deleted/>
        <created_id type=""
           uri="https://{domain}/networking/rest/record/USER/1"
           displayValue="">1</created_id>
        <owner_id type=""
           uri="https://{domain}/networking/rest/record/USER/5"
           displayValue="Admin">5</owner_id>
        <modified_id type=""
           uri="https://{domain}/networking/rest/record/USER/5"
           displayValue="Admin">5</modified_id>
        <number>1742261497</number>
        <name/>
        <search_string/>
        <start_date>2010-11-12T13:14:15Z</start_date>
        <payment_type/>
        <license_blocks/>
        <partner_id>597083057</partner_id>
        <country>United States</country>
        <next_billing_date/>
        <base_subscriber_plan type=""
           uri="https://{domain}/networking/rest/record/456zzy789jhk/null"
           displayValue=""/>
        <trial_account/>
        <accessory_purchase_plan type=""
           uri="https://{domain}/networking/rest/record/456zzy789jhk/null"
           displayValue=""/>
        <workflow_owners/>
        <data_space/>
        <date_modified>2010-11-12T13:14:15Z</date_modified>
        <company>Greene Services</company>
        <base_subscriber_option type=""
           uri="https://{domain}/networking/rest/record/456zzy789jhk/null"
           displayValue=""/>
        <msp>0</msp>
        <discount/>
        <workflow_state/>
        <active>1</active>
    </tenant>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Create a Tenant

Creates a new Tenant

Method
POST
URI
https://na.longjump.com/networking/rest/tenant
Request
<platform>
    <tenant>
        <company>BSmith Inc</company>
        <name>BSmith Inc</name>
        <email>bsmith@email.com</email>
        <last_name>Bob</last_name>
        <password>password</password>
        <first_name>Smith</first_name>
        <phone>650-555-1212</phone>
        <number_of_users>1</number_of_users>
        <estimated_number_of_users>4</estimated_number_of_users>
        <country>United States</country>
        <date_format>mm/dd/yyyy</date_format>
        <currency_format>$</currency_format>
        <time_zone>12</time_zone>
        <street>1230 Midas Way</street>
        <city>Sunnyvale</city>
        <force_password_to_be_changed>0</force_password_to_be_changed>
    </tenant>
</platform>
Notes
  • To create a new MSP, pass the following with the request:
<is_partner>1</is_partner>
  • To create a new tenant for an MSP, pass the following with the request, where {customer_id} is the MSP's tenant ID:
<partner>{customer_id}</partner>
<appList>4949678694fe4ccd9dcdfd9c32c49521,
         eodf3997d57d4c7bb57f28d4e58d364f</appList>
where:
  • Whitespace between the values is ignored
  • The values are package installation IDs -- the values that appear as the id value in the Installation Link part of the Package page.
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>      
        <id>...</id>  <!-- tenant ID -->  
    </message>
</platform>
See also: REST API:Error Codes

Search Tenants

Method
GET
URI
https://na.longjump.com/networking/rest/tenant?{query_parameters}
Sample Search
?fieldList=name,id & filter=name contains 'smith' & sortby='id'
(Field names are in the Fields section.)
Query Parameters
  • fieldList - A comma-separated list of field names to retrieve
  • The asterisk (*) wildcard specifies all fields
  • Use the REST API:field Resource to get a complete list of fields
  • Field lists for database views need to specify the object's alias, as well as the field name.
  • filter - Filtering criteria to filter the records
  • pageSize - Number of records to retrieve from the result set in order to make a "page".
  • page - Number of the logical page in a database result set. The first page is page "zero" (0).
Page zero is returned by default, so appending &pageSize=1 to your query returns a single record.
  • getTotalRecordCount returns the number of total records.
    Causes the following structure to be returned, where N is the total number of records:
<platform>
   ...
   <message>
      <code>0</code>
      <description>Success</description>
   </message>

   <!-- added by the query param -->
   <totalRecordCount>N</totalRecordCount>
</platform>
  • sortBy - Field name for primary sort
    Ex: &sortBy=name
  • sortOrder - Sort order of the primary field, either "asc" or "desc" (ascending or descending)
    Ex: &sortOrder="desc"
  • sortBy2 - Field name for secondary sort
  • sortOrder2 - Sort order of the second field, either "asc" or "desc" (ascending or descending)
For more information, see: Specifying Query Parameters in REST APIs

Update a Tenant

Updates Tenant information

Method
PUT
URI
https://na.longjump.com/networking/rest/tenant/{tenant_id}
Request
<platform>
<tenant>
    <free>1</free>
    <country>India</country>
    <payment_type>Manual</payment_type>
</tenant>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>        
    </message>
</platform>
See also: REST API:Error Codes

Delete a Tenant

Deletes a Tenant, and all related information

Method
DELETE
URI
https://na.longjump.com/networking/rest/tenant/{tenant_id}
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>        
    </message>
</platform>
See also: REST API:Error Codes

Fields

Name Type Attributes Required During Add Description Additional Information
company String Company Name
email email Email address of the User
first_name String User First Name
last_name String User Last Name
password String Password
time_zone int Time zone ID Time Zone Codes
date_format String Date Format
phone String User Phone
number_of_users int Number Of Users
document_space int per User document space
is_partner boolean Designates if the Tenant being created is an MSP or Tenant
partner String Tenant id of the MSP Must be set for MSP client creation
object_id StringRead Only tenant object idDefault: 8c5b349851c041a28d19277a12dee8f0
number intRead Only Tenant Number
deleted BooleanRead Only Designates if the Tenant is active or not
discount percentage Discount for the tenant
created_id StringRead Only
data_space int per user data space
classification String Customer classification
owner_id StringRead Only
start_date dateRead Only registration date UTC Format
country String
city String
state String
sendWelcomeEmail Boolean Sends a welcome email when set to 1Default: 0
force_password_change_on_login Boolean Prompts for password reset on first login when set to 1Default: 1
street String
zip String
base_subscriber_plan Lookup Tenant's purchase plan URI attribute contains record URL
base_subscriber_option Lookup Tenant's payment plan URI attribute contains record URL
accessory_purchase_plan Lookup Tenant's plan for purchasing additional usage-resources. URI attribute contains record URL
Personal tools