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

From AgileApps Support Wiki
imported>Aeric
imported>Aeric
Line 220: Line 220:
| id || String || align="center"|Read Only || || || [[Record Id]]
| id || String || align="center"|Read Only || || || [[Record Id]]
|-
|-
| name || String || || align="center"|[[File:Checkmark.gif|link=]] || || Β 
| name || String || || align="center"|[[File:Checkmark.gif|link=]] || Mapping profile name || Β 
|-
|-
| description || String || || || || Β 
| description || String || || || || Β 
|-
Β 
| ...|| ... || ... || ... || ... || ...
|-
| tag || String || align="center"|Read Only || || description || AddlInfo
|-
| tag || String || || || description || AddlInfo
|-
|-
| tag || String || || align="center"|[[File:Checkmark.gif|link=]] || description || AddlInfo
| mapping || ??? || || align="center"|[[File:Checkmark.gif|link=]] || Describes the mapping betweeen the CSV columns and Platform fields.|| Β 
|-
|-
| tag || String || align="center"|Writable on Add only || align="center"|[[File:Checkmark.gif|link=]] || description || AddlInfo
| advancedOptions || Defines additional mapping profile options || || align="center"|[[File:Checkmark.gif|link=]] || description || AddlInfo
|-
| ...|| ... || ... || ... || ... || ...
|-
| ...|| ... || ... || ... || ... || ...


|- Β 
|- Β 
Line 250: Line 241:
| modified_id || Lookup || align="center"|Read Only || || || [[REST API:User Resource|User]] ID
| modified_id || Lookup || align="center"|Read Only || || || [[REST API:User Resource|User]] ID
|}
|}
-or-
Β 
:{| border="1" cellpadding="5" cellspacing="0"
:{| border="1" cellpadding="5" cellspacing="0"
! Name !! Type !! Attribute !! Default Value !! Description !! Additional Information
! Name!!Type!!Attribute!!Required on Add!!Description!!Additional Information
|-
| tag || String || align="center"|Read Only || Default || description || AddlInfo
|-
| tag || String ||Β  || Default || description || AddlInfo
|-
| ...|| ... || ... || ... || ... || ...
|-
| ...|| ... || ... || ... || ... || ...
Β 
|-
| colspan="6"Β  bgcolor="Azure" style="height:7px" |Β  <!-- SPACER ROW -->
Β 
|-
|-
| date_modified || Date || align="center"|Read Only || || || [[UTC Format]]
| field || String || || || descr || addl info
|-
| date_created || Date || align="center"|Read Only || || || [[UTC Format]]
|-
| created_id || Lookup || align="center"|Read Only || || || [[REST API:User Resource|User]] ID
|-
| modified_id || Lookup || align="center"|Read Only || || || [[REST API:User Resource|User]] ID
|}
|}



Revision as of 23:52, 19 April 2012

Manage import field-mapping profiles using the REST API.

Learn more:

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}
Response
<syntaxhighlight lang="xml" enclose="div">

<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>
       0
       <description>Success</description>
   </message>
   <recordCount>N</recordCount>      

</platform> </syntaxhighlight>

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
<syntaxhighlight lang="xml" enclose="div">

<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>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Add an Import Field-Mapping Profile

Method
POST
URI
https://{domain}/networking/rest/import/{objectName}
Request
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <mappingProfile>
       <name>TestMap</name>
       <description/>
       <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="" 
               displayValue="Justin Thyme">d684f1b1ed754402b986364eeaa11417</recordOwner>
           <lookupFieldOptions>
               <lookupFieldOption lookupColumnName="Lk">time_field</lookupFieldOption>
           </lookupFieldOptions>
       </advancedOptions>
   </mappingProfile>

</platform> </syntaxhighlight>

Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>
       <id>...</id>   
   </message>

</platform> </syntaxhighlight>

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
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <mappingProfile>
       <name>TestMap</name>
       <description/>
       <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="" 
               displayValue="Justin Thyme">d684f1b1ed754402b986364eeaa11417</recordOwner>
           <lookupFieldOptions>
               <lookupFieldOption lookupColumnName="Lk">time_field</lookupFieldOption>
           </lookupFieldOptions>
       </advancedOptions>
   </mappingProfile>

</platform> </syntaxhighlight>

Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Delete an Import Field Mapping Profile

Method
DELETE
URI
https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}
Record ID of the mapping profile can also be specified.
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <message>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

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 Mapping profile name
description String
mapping ??? Checkmark.gif Describes the mapping betweeen the CSV columns and Platform fields.
advancedOptions Defines additional mapping profile options 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
Name Type Attribute Required on Add Description Additional Information
field String descr addl info

Error Codes

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

Learn more: