Catalyst Integrated Export API

Follow

Catalyst’s API for Export feature allows you to automate your exports.. Additionally, it allows you to link your Catalyst data to an external reporting service for customized dashboards! Personally, we like Zoho Reports for this, but this export allows you the freedom to find the service of your choice.

Before you can set up an automatic export, you will need two pieces of information; an Access Token and some module parameters. You can get your Access Token by following the Getting the Access Token section of the Catalyst API article.

The next thing you will need are module parameters. You can find out what the correct parameters are by going to the Import/Export page and hovering over an export link. In the url you will see a parameter called module followed by a value. You can use that to create the correct request. Some lists may require an additional parameter; for example, some insights lists require a parameter called Level and the value must be ‘full’ or ‘base’.

Here is a list of the parameters you will need to recreate the files from the different export options:

Core lists

Section Parameter Parameter Value
Products and Services module Products
Internal Contacts module InternalContacts
Locations module Locations
Suppliers module Suppliers
Risks module Risks
Actions module BcActions
Applications module AdminApplication
IT Items module ItItems

Department

Section Parameter Parameter Value Secondary Parameter Secondary Parameter Value
Departments (All Sections) module Departments N/A N/A
Departments module Departments section Department
Activities module Departments section Activity
Recovery Staffing Requirements module Departments section RecoveryStaffing
Resource Requirements module Departments section RecoveryResource
Recovery Spaces module Departments section RecoverySpaces

Dependencies

Section Parameter Parameter Value Secondary Parameter Secondary Parameter Value
Application Dependencies module Departments section ApplicationDependency
Facility Dependencies module Departments section FacilityDependency
Supplier Dependencies module Departments section SupplierDependency
Department Dependencies module Departments section DepartmentDependency
Other Dependencies module Departments section OtherDependency

Planning and Insights

Section Parameter Parameter Value Secondary Parameter Secondary Parameter Value
Plans module Plans N/A N/A
Exercises module Exercises N/A N/A
Insights Ratings w/ Dependencies level full module Insights
Insights Individual Ratings level base module Insights
External Contacts module ExternalContacts N/A N/A

The last step is to create an API call to Catalyst with the relevant export information (see below). API calls can be written in many different languages (AJAX, Ruby, etc.). This is the part you’ll likely need your internal IT team’s help.

API requests need to include a header with the key (“authorization”), and value (“Token token=[insert token key]”). The “[insert token key]” should be replaced with the Access Token from the “Obtaining Access Token” steps above.

Request Examples:

The following example is a Ruby API post

_require ‘uri’
require ‘net/http’

url = URI

http = Net::HTTP.new(url.host, url.port)

http.use_ssl = true
request = Net::HTTP::Post.new(url)
request[“content-type”] = ‘multipart/form-data; boundary=——WebKitFormBoundary7MA4YWxkTrZu0gW’
request[“authorization”] = ‘Token token=[copied token key]’
request.body = “———WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\“async\”\r\n\r\nfalse\r\n———WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\“module\”\r\n\r\n[parameter]\r\n[additional parameter]———WebKitFormBoundary7MA4YWxkTrZu0gW—”
response = http.request(request)

export_file = File.new(File.expand_path(“~/Desktop/export.xls”), “w+b”)
export_file.write(response.read_body)
export_file.close_

  • Replace “[site]” with your Catalyst site prefix.
  • Replace “[copied token key]” with your user Access Token
  • Replace “[parameter]” with the module value from either the list above or from viewing the export link in Catalyst
  • Remove [additional parameter] if not needed, otherwise replace with:
    ———WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\”[level or section]\”\r\n\r\n[level or section parameter value]\r\n
    • Replace [level or section] with appropriate value from either the list above or from viewing the export link in Catalyst
    • Replace [level or section parameter value] with appropriate value from either the list above or from viewing the export link in Catalyst

The following example is a CURL API post

_curl -X POST \ http://[site].bccatalyst.com/export/export.xls \ -H ‘authorization: Token token=[copied token key]’ \ -H ‘cache-control: no-cache’ \ -H ‘content-type: multipart/form-data; boundary=——WebKitFormBoundary7MA4YWxkTrZu0gW’ \ -F async=false \ -F module=[parameter]
[additional parameter] > filename.xls_
  • Replace “[copied token key]” with your user Access Token.
  • Replace “[site]” with your Catalyst site prefix.
  • Replace “[parameter]” with the module value from either the list above or from viewing the export link in Catalyst
  • Remove [additional parameter] if not needed, otherwise replace with: -F [level or section]=[additional parameter]
    • Replace [level or section] with appropriate value from either the list above or from viewing the export link in Catalyst
    • Replace [level or section parameter value] with appropriate value from either the list above or from viewing the export link in Catalyst
Have more questions? Submit a request

Comments