AgileApps Support Wiki Pre Release

REST API:import Status Resource

From AgileApps Support Wiki

Get Import Status

Report on the status of import jobs undertaken through the GUI, or using the REST bulk upload Resource.

Method
GET
URI
https://{yourDomain}/networking/rest/status/import/{job_id}
Response
<syntaxhighlight lang="xml" enclose="div">

<platform>

   <status>
       <import>
           <id>197rfy238qaz</id>
           <fileName>emp1.csv</fileName>
           <mapping>

|CONTACT_COUNTRY,5|NAME,0|COUNTRY,5|BILLING_ACCOUNT,3|NUMBER,1

           </mapping>
           <totalRecords>5</totalRecords>
           <addedRecords>0</addedRecords>
           <mergedRecords>0</mergedRecords>
           <ignoredRecords>0</ignoredRecords> 
           <status>In Processing Queue</status>
           <statusCode>1</statusCode>
           <date_created>2010-12-19T05:50:18.000Z</date_created>
           <created_id type="USER"
              uri="https://{yourDomain}/networking/rest/user/qwe123rty456" 
              displayValue="Rita Goodbook">qwe123rty456</created_id>
       </import>
   </status>
   <message>
       0
       <description>Success</description>
   </message>

</platform> </syntaxhighlight>

See also: REST API:Error Codes

Dynamic Search for Import Status Records

Method
GET
URI
https://{yourDomain}/networking/rest/status/import?{query_parameters}
Sample Search
?fieldList=fileName,status&filter=objectName contains 'contact'
(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
  • {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
  • 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)
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

Name Type Description
id String ID of the scheduled import job
filename String Data file used for upload
mapping String Name of the Mapping profile used for import
totalRecords String Number of records in the file
addedRecords String Number of added records
mergedRecords String Number of merged records
ignoredRecords String Number of rejected Records
ignoredReason String A list of up to 50 rejection messages, separated by asterisks (*). (This field only appears if one or more records are rejected.)
statusCode String Status code. (See table below)
status String Status message (See table below)
objectName String Object into which data is imported
processStartDate Date Date and time the import started, in UTC Format
processEndDate Date Date and time the import completed, in UTC Format
date_created Date Date and time the import job was submitted, in UTC Format
created_id Lookup ID of the User who created the job
 

Scheduled jobs may be in one of the following states. (Constants are defined in com.platform.api.CONSTANTS.STATUS)

statusCode
(int)
status
(String)

Description
IN_PROCESS_QUEUE "In process queue" Job has been accepted by the scheduler.
STARTED "Started" Job is currently being processed.
COMPLETED "Completed" Job finished.
WAITING_TO_BE_STOPPED "Waiting to be stopped" Job started, but user has issued a STOP request.
Processing is continuing until an appropriate stopping-point is reached. (Note: The STOP operation is not available for all jobs.)
STOPPED "Stopped" Job was stopped by user.