Difference between revisions of "REST API:import Mapping Profile Resource"
imported>Aeric |
imported>Aeric |
||
Line 15: | Line 15: | ||
{{permissions|Manage Develop Features|use this resource.}} | {{permissions|Manage Develop Features|use this resource.}} | ||
===List All | ===List All 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.) | ("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 | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/ | ;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}</nowiki></tt> | ||
:Return all fields | :Return all fields | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/ | ;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}?{query_parameters}</nowiki></tt> | ||
{{Query Parameters| | {{Query Parameters| | ||
Line 34: | Line 34: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<platform> | <platform> | ||
< | <mappingProfile> | ||
<id>...</id> | <id>...</id> | ||
<field>data</field> | <field>data</field> | ||
... | ... | ||
</ | </mappingProfile> | ||
< | <mappingProfile> | ||
... | ... | ||
</ | </mappingProfile> | ||
... | ... | ||
Line 56: | Line 56: | ||
:See also: [[REST API:Error Codes]] | :See also: [[REST API:Error Codes]] | ||
===Get | ===Get an Import Field Mapping Profile=== | ||
;Method:GET | ;Method:GET | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/ | ;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}</nowiki></tt> | ||
:Return all fields | :Return all fields | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/ | ;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}?{query_parameters}</nowiki></tt> | ||
{{Query Parameters| | {{Query Parameters| | ||
:Introductory sentence, if any | :Introductory sentence, if any | ||
Line 72: | Line 72: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<platform> | <platform> | ||
< | <mappingProfile> | ||
<id>...</id> | <id>...</id> | ||
<field>data</field> | <field>data</field> | ||
... | ... | ||
</ | </mappingProfile> | ||
<message> | <message> | ||
Line 87: | Line 87: | ||
:See also: [[REST API:Error Codes]] | :See also: [[REST API:Error Codes]] | ||
===Add | ===Add an Import Field-Mapping Profile=== | ||
;Method:POST | ;Method:POST | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/ | ;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}</nowiki></tt> | ||
;Request: | ;Request: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<platform> | <platform> | ||
< | <mappingProfile> | ||
<field>data</field> | <field>data</field> | ||
... | ... | ||
</ | </mappingProfile> | ||
</platform> | </platform> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 109: | Line 109: | ||
<code>0</code> | <code>0</code> | ||
<description>Success</description> | <description>Success</description> | ||
<id>...</id> <!-- ID of the newly created | <id>...</id> <!-- ID of the newly created mappingProfile --> | ||
</message> | </message> | ||
</platform> | </platform> | ||
Line 116: | Line 116: | ||
:See also: [[REST API:Error Codes]] | :See also: [[REST API:Error Codes]] | ||
===Update | ===Update an Import Field-Mapping Profile=== | ||
;Method:PUT | ;Method:PUT | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/ | ;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}</nowiki></tt> | ||
;Request: | ;Request: | ||
:<syntaxhighlight lang="xml" enclose="div"> | :<syntaxhighlight lang="xml" enclose="div"> | ||
<platform> | <platform> | ||
< | <mappingProfile> | ||
<id>{recordId}</id> | <id>{recordId}</id> | ||
... | ... | ||
</ | </mappingProfile> | ||
</platform> | </platform> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 143: | Line 143: | ||
:See also: [[REST API:Error Codes]] | :See also: [[REST API:Error Codes]] | ||
===Delete | ===Delete an Import Field Mapping Profile === | ||
;Method:DELETE | ;Method:DELETE | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/ | ;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}/{mapping_profile_name}</nowiki></tt> | ||
;Response: | ;Response: | ||
Line 161: | Line 161: | ||
:See also: [[REST API:Error Codes]] | :See also: [[REST API:Error Codes]] | ||
===Dynamic Search for | ===Dynamic Search for Import Field-Mapping Profiles=== | ||
;Method:GET | ;Method:GET | ||
;URI:<tt><nowiki>https://{domain}/networking/rest/ | ;URI:<tt><nowiki>https://{domain}/networking/rest/import/{objectName}?{query_parameters}</nowiki></tt> | ||
{{:REST API:Dynamic Search}} | {{:REST API:Dynamic Search}} | ||
Line 252: | Line 252: | ||
:* See the [[REST API:Error Codes]] for common Http error codes | :* See the [[REST API:Error Codes]] for common Http error codes | ||
:* See the [{{DOCHOST}}/javadocs/constant-values.html javadoc constants] for a complete list of <tt>PlatformException</tt> error-code constants. | :* See the [{{DOCHOST}}/javadocs/constant-values.html javadoc constants] for a complete list of <tt>PlatformException</tt> error-code constants. | ||
<noinclude> | <noinclude> | ||
[[Category:REST API| | [[Category:REST API|importMappingProfile Resource]] | ||
</noinclude> | </noinclude> | ||
Revision as of 23:28, 19 April 2012
Manage import field-mapping profiles using the REST API.
- Learn more: REST API Conventions and Considerations.
Requirements
- Requirement #1
- Requirement #2
Permissions
__TBD: Are the permission(s) right?__ -- check Administrative Permissions for a list of possibilities
Users that have the Access Control/User Management permission can use this resource.
Users that have the Manage Develop Features permission can use this resource.
List All 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
- 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
- <syntaxhighlight lang="xml" enclose="div">
<platform>
<mappingProfile> <id>...</id> <field>data</field> ... </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}
- 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, ... (default)
- For more information, see: Specifying Query Parameters in REST APIs
- Response
- <syntaxhighlight lang="xml" enclose="div">
<platform>
<mappingProfile> <id>...</id> <field>data</field> ... </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> <field>data</field> ... </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> <id>{recordId}</id> ... </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}
- Response
- <syntaxhighlight lang="xml" enclose="div">
<platform>
<message>
0
<description>Success</description>
</message>
</platform> </syntaxhighlight>
- See also: REST API:Error Codes
Dynamic Search for Import Field-Mapping Profiles
- Method
- GET
- URI
- https://{domain}/networking/rest/import/{objectName}?{query_parameters}
- Query Parameters
- fieldList - A comma-separated list of field names to retrieve
- The asterisk (*) wildcard specifies all fields
- {fieldname} specifies an individual field (e.g. name)
- (Use the REST API:field Resource to get a complete list of fields.)
- For a Composite Object, specify {alias}.{fieldname} to select a related-record field, where the alias is defined in the Object Relationships.
- For a Database View, specify {alias}.{fieldname}, where the object alias is defined in the Database View.
- alias.* specifies all fields in the aliased object.
- filter - Filtering criteria to filter the records
- For more examples, see Filter Expressions in REST APIs and the REST API Examples.)
- 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:
- <syntaxhighlight lang="xml" enclose="div">
<platform>
<status>
<packageDeploy>
...
</packageDeploy>
</status>
<message>
0
<description>Success</description>
</message>
<totalRecordCount>N</totalRecordCount>
</platform> </syntaxhighlight>
- 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)
- sortBy - Field name for primary sort
- For more information, see: Specifying Query Parameters in REST APIs
- 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 description String ... ... ... ... ... ... tag String Read Only description AddlInfo tag String description AddlInfo tag String description AddlInfo tag String Writable on Add only 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:
- See the REST API:Error Codes for common Http error codes
- See the javadoc constants for a complete list of PlatformException error-code constants.