promax-api-modules
v0.2.0
Published
Set of axios functions to interact with CEC's RESTful API
Downloads
2
Readme
API Docs
ApiService (A.K.A BaseController)
Instantiation
- Arguments:
- companyName - String - 'ATG', 'CEC', or 'MEX' (upper or lower case)
- environment - String - 'Production', 'Staging', or 'Local'
- apiKey - String - used to verify that the application has permission to use the API
API key controller
createRecord
- Function:
- adds a new record to the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- data - JSON object - contains some or all of the following fields: 'id', 'keyName'
- Return:
- body - String - HTTP status code corresponding with the result of the request
deleteRecord
- Function:
- removes an existing record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- id - String - unique value used to identify a record
- Return:
- body - JSON object - object containing the record that has been deleted
getAllRecords
- Function:
- obtain some details about all records from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- Return:
- body - JSON object - an object with only the 'id' and 'keyName' fields on success. Error message on failure
getOneRecord
- Function:
- obtain all details about one record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- id - String - unique value used to identify a record
- Return:
- body - JSON object - an object with all fields including 'lastModified' on success. Error message on failure
updateRecord
- Function:
- change the details about one record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- data - JSON object - contains some or all of the following fields: 'keyName'
- id - String - unique value used to identify a record
- Return:
- body - String - HTTP status code corresponding with the result of the request
billing terms controller
createRecord
- Function:
- adds a new record to the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- data - JSON object - contains some or all of the following fields: 'id', 'days', 'desc'
- Return:
- body - String - HTTP status code corresponding with the result of the request
deleteRecord
- Function:
- removes an existing record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- id - String - unique value used to identify a record
- Return:
- body - JSON object - object containing the record that has been deleted
getAllRecords
- Function:
- obtain some details about all records from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- Return:
- body - JSON object - an object with only the 'id' and 'desc' fields on success. Error message on failure
getOneRecord
- Function:
- obtain all details about one record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- id - String - unique value used to identify a record
- Return:
- body - JSON object - an object with all available fields on success. Error message on failure
updateRecord
- Function:
- change the details about one record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- data - JSON object - contains some or all of the following fields: 'days', 'desc'
- id - String - unique value used to identify a record
- Return:
- body - String - HTTP status code corresponding with the result of the request
forecast review controller
createRecord
- Function:
- adds a new record to the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- data - JSON object - contains some or all of the following fields: 'jobNumber', 'notes', 'userName'
- Return:
- body - String - HTTP status code corresponding with the result of the request
getJobRecords
- Function:
- obtain all records for the specified job from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- jobNum - String - ID of the job
- Return:
- body - JSON object - objects with all fields on success. Error message on failure
getOneRecord
- Function:
- obtain only the most recent record for each job from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- Return:
- body - JSON object - an object with all fields on success. Error message on failure
OEM controller
createRecord
- Function:
- adds a new record to the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- data - JSON object - contains some or all of the following fields: 'address1', 'address2', 'city', 'faxPhone', 'oemName', 'state', 'voicePhone', 'website', 'zipCode'
- Return:
- body - String - HTTP status code corresponding with the result of the request
deleteRecord
- Function:
- removes an existing record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- id - String - unique value used to identify a record
- Return:
- body - JSON object - object containing the record that has been deleted
getAllRecords
- Function:
- obtain some details about all records from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- Return:
- body - JSON object - an object with only the 'id' and 'oemName' fields on success. Error message on failure
getOneRecord
- Function:
- obtain all details about one record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- id - String - unique value used to identify a record
- Return:
- body - JSON object - an object with all fields including 'id' and 'version' on success. Error message on failure
updateRecord
- Function:
- change the details about one record from the DB
- Parameters:
- accessToken - String - Authorization header value that excludes 'bearer '. Allow the API to verify the user making each request.
- data - JSON object - contains some or all of the following fields: 'address1', 'address2', 'city', 'faxPhone', 'oemName', 'state', 'voicePhone', 'website', 'zipCode'
- id - String - unique value used to identify a record
- Return:
- body - String - HTTP status code corresponding with the result of the request