Contract Import

"You can use Alliant API to Import Contract data to the Alliant system by sending requests with pages of Contract data to the Import Contract endpoints. When all of the Contracts in an Import Contract Batch have been sent, you use the Submit parameter to submit the Import Batch Job for processing by the Import Batch Service. When you want to Import Contract data into the Alliant system, you must first create the Import Contract Batch using the HTTP POST api/Import/Contracts/Batch endpoint. You can send the first page of Contract data with the POST endpoint. When the Import Contract Batch includes only a single page of Contract data that is included in the POST request, you can create the Import Contract Batch and submit it for processing in the same request using the Submit parameter. When the Import Contract Batch includes multiple pages of Contract data, you send each page of Contracts and submit the batch for processing using the HTTP PATCH api/Import/Contracts/Batch/{batchId} endpoint after the Import Contract Batch is created using the HTTP POST endpoint. You can read the data for an Import Contract Batch using the HTTP GET api/Import/Contracts/Batch/{batchId} endpoint. When you want to clear the Contracts from an Import Contract Batch, you can use the HTTP POST api/Import/Contracts/Batch/{batchId}/clear."

Create an Import Contract Batch

When you want to Import Contract data into the Alliant system, you must first issue this endpoint to create the Import Contract Batch.

The POST Request Body must include the Import File Name, the page size (the number of Contracts to be submitted per batch), and the total number of Contracts. When a batch of Contract data is included in the initial POST Request, the POST Request Body also includes a Description for the batch, a page number for the batch, and an array of Contract data. When the entire batch of Contracts is contained within the POST request, you can use the Submit parameter to submit the job for processing in the same request. The request response includes the batchId value used to submit subsequent pages of Import Contract data for the Batch Job.

SecurityHeaderToken
Request
query Parameters
submit
integer

Use the submit parameter to submit the Import job for processing by the Import Batch Service. You should only include this parameter with the last page of Items or after all of the Items for the batch have been submitted.

jobPriority
integer

Use the jobPriority parameter when submitting the Import Job to set the Job Priority value for the Import Job. When you do not specify this value when submitting the Import Job, the Highest Priority value for the associated Job Class is used for the Import Job. This value is ignored when the submit parameter is not present.

Examples:
Specifies a Job Priority value of 1.
jobPriority=1
jobClass
string

Use the jobClass parameter when submitting the Import Job to specify the Job Class for the Import Job. When you do not specify this value when submitting the Import Job, the first Job Class in the Alliant system for which the Alliant User has permissions (determined alphabetically by the Job Class Description values) is used for the Import Job. This value is ignored when the submit parameter is not present.

Examples:
Specifies the 'Any Time of the Day' Job Class.
jobClass=Any Time of the Day
Request Body schema: application/json
required

Include as much information as possible regarding the Import Contract Batch

importFileName
required
string [ 1 .. 255 ] characters

Specify the name of the Import File Definition that you want to use to Import the Contract data. The Import File Definition must be associated with an Import File Type that is configured to use the Contract Staging Area to Import to the Posted History table.

description
string [ 1 .. 255 ] characters

Specify a Description for the Import Contract Batch.

pageSize
required
integer [ 1 .. 4 ] characters

Specify the page size (the number of Contracts per page) for submitting Contracts for the Batch. This is a required value that must be between 1 and 1000.

totalItems
required
integer [ 1 .. 10 ] characters

Specify the total number of Contracts to be submitted for the Batch. This is a required value that must be between 1 and 2147483647.

pageNumber
integer

Specify a Page Number value for the Contracts included in the request, when necessary. This must be a unique value for the Import Contract Batch. The first Page Number must be 0, the second Page Number is 1, and so forth.

Array of objects (Contract Import Properties)

Contracts

Responses
201

OK

400

Bad Request

403

Forbidden

404

Not Found

405

Method Not Allowed

409

Conflict

415

Unsupported Media Type

500

Internal Server Error

post/api/import/contracts/batch
Request samples
application/json
{
  • "importFileName": "APIContracts",
  • "description": "Contract Import from Alliant API",
  • "pageSize": 2,
  • "totalItems": 2
}
Response samples
application/json
{
  • "result": {
    },
  • "errors": [ ],
  • "warnings": [ ],
  • "hasErrors": false,
  • "hasWarnings": false
}

Submit Contracts for an Import Contract Batch

Once the Import Contract Batch is created using the HTTP POST endpoint, you submit each page of Contracts using this endpoint.

When you are submitting a page of Contract data, the PATCH Request Body must include the Page Number for the Contracts and an array of Contract data.  When you are submitting the final page of Contracts, you can also include the Submit parameter to submit the batch for processing.

When you are not submitting a page of Contract data but only submitting the batch for processing, no Request Body data is required and you must include the Submit parameter to submit the batch for processing.

Note: You cannot submit pages of Contracts to an Import Contract Batch that has been cleared. When you clear an Import Contract Batch, the Contract data is removed from the Database. However, you must create a new Import Contract Batch to submit new pages of Contracts.

SecurityHeaderToken
Request
path Parameters
batchID
required
string

Import Contract Batch ID

query Parameters
submit
integer

Use the submit parameter to submit the Import job for processing by the Import Batch Service. You should only include this parameter with the last page of Items or after all of the Items for the batch have been submitted.

jobPriority
integer

Use the jobPriority parameter when submitting the Import Job to set the Job Priority value for the Import Job. When you do not specify this value when submitting the Import Job, the Highest Priority value for the associated Job Class is used for the Import Job. This value is ignored when the submit parameter is not present.

Examples:
Specifies a Job Priority value of 1.
jobPriority=1
jobClass
string

Use the jobClass parameter when submitting the Import Job to specify the Job Class for the Import Job. When you do not specify this value when submitting the Import Job, the first Job Class in the Alliant system for which the Alliant User has permissions (determined alphabetically by the Job Class Description values) is used for the Import Job. This value is ignored when the submit parameter is not present.

Examples:
Specifies the 'Any Time of the Day' Job Class.
jobClass=Any Time of the Day
Request Body schema: application/json
required

Include the Page Number and the Contract data for the page of Contracts.

Note: The Request Body is required only when submitting a page of Contract data. When submitting the Import job for processing without a page of Contract data, no Request Body is required.

pageNumber
integer

Specify a Page Number value for the Contracts included in the request, when necessary. This must be a unique value for the Import Contract Batch. The first Page Number must be 0, the second Page Number is 1, and so forth.

Array of objects (Contract Import Properties)

Contracts

Responses
200

OK

400

Bad Request

403

Forbidden

404

Not Found

405

Method Not Allowed

409

Conflict

415

Unsupported Media Type

500

Internal Server Error

patch/api/import/contracts/batch/{batchID}
Request samples
application/json
{
  • "pageNumber": 0,
  • "items": [
    ]
}
Response samples
application/json
{
  • "result": { },
  • "errors": [ ],
  • "warnings": [ ],
  • "hasErrors": false,
  • "hasWarnings": false
}

Read Import Contract Batch Data

Read the data for an Import Contract Batch.

SecurityHeaderToken
Request
path Parameters
batchID
required
string

Import Contract Batch ID

query Parameters
pageNumber
integer

Use the pageNumber parameter when reading Import Contract Batch data to specify the page of Contract data that you want to retrieve, when applicable. The first Page Number is 0, the second Page Number is 1, and so forth.

Examples:
Specifies a Page Number value of 1.
pageNumber=1
Responses
200

OK

400

Bad Request

403

Forbidden

404

Not Found

405

Method Not Allowed

409

Conflict

415

Unsupported Media Type

500

Internal Server Error

get/api/import/contracts/batch/{batchID}
Response samples
application/json
{
  • "result": {
    },
  • "errors": [ ],
  • "warnings": [ ],
  • "hasErrors": false,
  • "hasWarnings": false
}