REST API:index Resource

From LongJump Support Wiki

Manage index metadata for an Object using the REST API.

Learn more: REST API Conventions and Considerations.

Permissions

Lock-tiny.gif

Users that have the Use Development Features permission can use this resource. 

Get a List of Object Indexes

Method
GET
URI
https://na.longjump.com/networking/rest/index/{objectName}
Response
<platform>
    <index>
        <name>AuthorIndex</name>
        <uniqueIndex>false</uniqueIndex>
        <useInImportForMerge>false</useInImportForMerge>
        <indexFields>author_name</indexFields>
    </index>

    <index>
         ...
    </index>

     ...

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
    <recordCount>N</recordCount>      <!-- Number of indexes returned -->
</platform>
See also: REST API:Error Codes

Get an Object Index

Method
GET
URI
https://na.longjump.com/networking/rest/index/{objectName}/{indexName}
Response
<platform>
    <index>
        <id>a5baa89caa064ed995c6c14f402db379</id>
        <objectName>Books</objectName>
        <name>AuthorIndex</name>
        <uniqueIndex>false</uniqueIndex>
        <useInImportForMerge>false</useInImportForMerge>
        <indexFields>author_name</indexFields>
        <date_created>2012-02-09T08:00:00.000Z</date_created>
        <date_modified>2012-02-13T08:00:00.000Z</date_modified>
        <modified_id 
             type="USER" uri="..." 
             displayValue="...">...userId...</modified_id>
    </index>

    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Add an Index to an Object

Method
POST
URI
https://na.longjump.com/networking/rest/index/{objectName}
Request
<platform>
    <index>
        <name>IBSN_Index</name>
        <uniqueIndex>false</uniqueIndex>
        <useInImportForMerge>false</useInImportForMerge>
        <indexFields>ibsn_number</indexFields>
    </index>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
        <id>...</id>   <!-- ID of the newly created index -->
    </message>
</platform>
See also: REST API:Error Codes

Update an Object Index

Method
PUT
URI
https://na.longjump.com/networking/rest/index/{objectName}/{indexName}
Request
(Only one field can be updated.)
<platform>
    <index>
      <useInImportForMerge>true</useInImportForMerge>
    </index>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Delete an Object Index

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

Fields

Note: Unless otherwise indicated, the attribute for a field is "Editable on Add or Update".
Name Type Attribute Required on Add Description Additional Information
id String Read Only Index ID Record Id
objectName String Read Only Object name
name String Add Only Checkmark.gif Index name
indexFields String Add Only Checkmark.gif Fields that make up the index Comma-separated list of field names
uniqueIndex Boolean Add Only If true, index keys must be unique true or false (default)
useInImportForMerge Boolean If true, index is used during an import merge true or false (default)
date_modified Date Read Only UTC Format
date_created Date Read Only UTC Format
created_id Lookup Read Only User ID
modified_id Lookup Read Only User ID

Error Codes

Platform Code with Http Status Description
-7000 BAD_REQUEST (400) Invalid index name

Learn more: