Difference between revisions of "REST API:import Mapping Profile Resource"

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 6: Line 6:
{{permissions|Manage Develop Features|use this resource.}}
{{permissions|Manage Develop Features|use this resource.}}


===List All Import Field-Mapping Profiles===
===List Import Field-Mapping Profiles===
("Get" if complete records are returned. "List" if partial data is returned, requiring a second read to get a complete set of data. This comes before the GET, because typically it's called first to get the ID used in a specific-record GET.)


;Method:GET
;Method:GET
Line 26: Line 25:
<platform>
<platform>
     <mappingProfile>
     <mappingProfile>
         <id>...</id>
         <id>1351233928</id>
         <field>data</field>
        <name>TestMap</name>
         ...
        <description/>
        <objectId>e8dc7a31353947729c2d1995e3185771</objectId>
        <date_created>2012-03-14T04:59:39.000Z</date_created>
        <date_modified>2012-03-14T20:51:37.000Z</date_modified>
        <modified_id
          type=""
          uri="https://localhost/networking/rest/USER/1424089492"
          displayValue="John Doe">1424089492</modified_id>
        <created_id         
          type=""
          uri="https://localhost/networking/rest/USER/1424089492"
          displayValue="John Doe">1424089492</created_id>
        <mapping>
            <energy csvColumnName="Energy (kWh)">2</lk>
            <numberField csvColumnName="Number">1</activiti_foreign_key>
        </mapping>
         <advancedOptions>
            <mergeOptions>MERGE_USING_PRIMARY_KEY</mergeOptions>
            <recordOwner          
              type=""
              uri="https://localhost/networking/rest/USER/1424089492"
              displayValue="John Doe">1424089492</recordOwner>
            <lookupFieldOptions>
                <lookupFieldOption lookupColumnName="Lk">time_field</lookupFieldOption>
            </lookupFieldOptions>
        </advancedOptions>
     </mappingProfile>
     </mappingProfile>


     <mappingProfile>
     <mappingProfile>
        ...
        ...
     </mappingProfile>
     </mappingProfile>
     ...
     ...


Line 41: Line 64:
         <description>Success</description>
         <description>Success</description>
     </message>
     </message>
     <recordCount>N</recordCount>      <!-- Number of __ records returned -->
     <recordCount>N</recordCount>      <!-- Number of mappingProfiles returned -->
</platform>
</platform>
</syntaxhighlight>
</syntaxhighlight>
Line 51: Line 74:
   
   
;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}</nowiki></tt>
;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}</nowiki></tt>
:Return all fields
;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}?{query_parameters}</nowiki></tt>
{{Query Parameters|
:Introductory sentence, if any
::*<tt>parameter1</tt> - Description
::*<tt>parameter2</tt>
:::* If <tt>true</tt>, ...
:::* If '''<tt>false</tt>''', ... ('''default''')}}


;Response:
;Response:
Line 64: Line 79:
<platform>
<platform>
     <mappingProfile>
     <mappingProfile>
         <id>...</id>
         <id>1351233928</id>
         <field>data</field>
        <name>TestMap</name>
         ...
        <description/>
        <objectId>e8dc7a31353947729c2d1995e3185771</objectId>
        <date_created>2012-03-14T04:59:39.000Z</date_created>
        <date_modified>2012-03-14T20:51:37.000Z</date_modified>
        <modified_id
          type=""
          uri="https://localhost/networking/rest/USER/1424089492"
          displayValue="John Doe">1424089492</modified_id>
        <created_id         
          type=""
          uri="https://localhost/networking/rest/USER/1424089492"
          displayValue="John Doe">1424089492</created_id>
        <mapping>
            <energy csvColumnName="Energy (kWh)">2</lk>
            <numberField csvColumnName="Number">1</activiti_foreign_key>
        </mapping>
         <advancedOptions>
            <mergeOptions>MERGE_USING_PRIMARY_KEY</mergeOptions>
            <recordOwner          
              type=""
              uri="https://localhost/networking/rest/USER/1424089492"
              displayValue="John Doe">1424089492</recordOwner>
            <lookupFieldOptions>
                <lookupFieldOption lookupColumnName="Lk">time_field</lookupFieldOption>
            </lookupFieldOptions>
        </advancedOptions>
     </mappingProfile>
     </mappingProfile>


Line 152: Line 192:
:See also: [[REST API:Error Codes]]
:See also: [[REST API:Error Codes]]


===Dynamic Search for Import Field-Mapping Profiles===
;Method:GET
;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}?{query_parameters}</nowiki></tt>
{{:REST API:Dynamic Search}}
;Response:
:<syntaxhighlight lang="xml" enclose="div">
<platform>
    ....
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
</syntaxhighlight>
:See also: [[REST API:Error Codes]]


===Fields===
===Fields===

Revision as of 23:37, 19 April 2012

Manage import field-mapping profiles using the REST API.

Learn more: REST API Conventions and Considerations.

Permissions

Lock-tiny.gif

Users that have the Manage Develop Features permission can use this resource. 

List Import Field-Mapping Profiles

Method
GET
URI
https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}
Return all fields
URI
https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}?{query_parameters}
Query Parameters
Introductory sentence, if any
  • parameter1 - Description
  • parameter2
  • If TRUE, ...
  • If FALSE, ...
For more information, see: Specifying Query Parameters in REST APIs
Response
<platform>
    <mappingProfile>
        <id>1351233928</id>
        <name>TestMap</name>
        <description/>
        <objectId>e8dc7a31353947729c2d1995e3185771</objectId>
        <date_created>2012-03-14T04:59:39.000Z</date_created>
        <date_modified>2012-03-14T20:51:37.000Z</date_modified>
        <modified_id 
           type="" 
           uri="https://localhost/networking/rest/USER/1424089492" 
           displayValue="John Doe">1424089492</modified_id>
        <created_id          
           type="" 
           uri="https://localhost/networking/rest/USER/1424089492" 
           displayValue="John Doe">1424089492</created_id>
        <mapping>
            <energy csvColumnName="Energy (kWh)">2</lk>
            <numberField csvColumnName="Number">1</activiti_foreign_key>
        </mapping>
        <advancedOptions>
            <mergeOptions>MERGE_USING_PRIMARY_KEY</mergeOptions>
            <recordOwner          
               type="" 
               uri="https://localhost/networking/rest/USER/1424089492" 
               displayValue="John Doe">1424089492</recordOwner>
            <lookupFieldOptions>
                <lookupFieldOption lookupColumnName="Lk">time_field</lookupFieldOption>
            </lookupFieldOptions>
        </advancedOptions>
    </mappingProfile>

    <mappingProfile>
        ...
    </mappingProfile>
     ...

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

Get an Import Field Mapping Profile

Method
GET
URI
https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}
Response
<platform>
    <mappingProfile>
        <id>1351233928</id>
        <name>TestMap</name>
        <description/>
        <objectId>e8dc7a31353947729c2d1995e3185771</objectId>
        <date_created>2012-03-14T04:59:39.000Z</date_created>
        <date_modified>2012-03-14T20:51:37.000Z</date_modified>
        <modified_id 
           type="" 
           uri="https://localhost/networking/rest/USER/1424089492" 
           displayValue="John Doe">1424089492</modified_id>
        <created_id          
           type="" 
           uri="https://localhost/networking/rest/USER/1424089492" 
           displayValue="John Doe">1424089492</created_id>
        <mapping>
            <energy csvColumnName="Energy (kWh)">2</lk>
            <numberField csvColumnName="Number">1</activiti_foreign_key>
        </mapping>
        <advancedOptions>
            <mergeOptions>MERGE_USING_PRIMARY_KEY</mergeOptions>
            <recordOwner          
               type="" 
               uri="https://localhost/networking/rest/USER/1424089492" 
               displayValue="John Doe">1424089492</recordOwner>
            <lookupFieldOptions>
                <lookupFieldOption lookupColumnName="Lk">time_field</lookupFieldOption>
            </lookupFieldOptions>
        </advancedOptions>
    </mappingProfile>

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

Add an Import Field-Mapping Profile

Method
POST
URI
https://{domain}/networking/rest/import/{objectName}
Request
<platform>
    <mappingProfile>
        <field>data</field>
         ...
    </mappingProfile>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
        <id>...</id>   <!-- ID of the newly created mappingProfile -->
    </message>
</platform>
See also: REST API:Error Codes

Update an Import Field-Mapping Profile

Method
PUT
URI
https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}
Request
<platform>
    <mappingProfile>
        <id>{recordId}</id>
         ...
    </mappingProfile>
</platform>
Response
<platform>
    <message>
        <code>0</code>
        <description>Success</description>
    </message>
</platform>
See also: REST API:Error Codes

Delete an Import Field Mapping Profile

Method
DELETE
URI
https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}
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 Record Id
name String Checkmark.gif
description String
... ... ... ... ... ...
tag String Read Only description AddlInfo
tag String description AddlInfo
tag String Checkmark.gif description AddlInfo
tag String Writable on Add only Checkmark.gif description AddlInfo
... ... ... ... ... ...
... ... ... ... ... ...
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

-or-

Name Type Attribute Default Value Description Additional Information
tag String Read Only Default description AddlInfo
tag String Default description AddlInfo
... ... ... ... ... ...
... ... ... ... ... ...
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: