API v1 - API Profile

API v1 - API Profile


This article belongs to series on API Profiles and the Matillion ETL v1 API.

The APIProfile endpoint allows users to manage their API Profiles similarly to how they can be accessed inside the client via Project Menu → Manage API Profiles.


Exporting/Importing an API profile.

API Profiles can be exported and imported via the API. This requires the user to go into the endpoint for a specific, existing API Profile and import 
 

Export an API Profile
curl -X GET -o MyAPIProfile.json -u user:password https://<InstanceAddress>/rest/v1/apiprofile/name/MyProfile/export

Import an API Profile

curl -X POST -u user:password "https://<InstanceAddress>/rest/v1/apiprofile/import" -H "Content-Type: application/json" --data-binary @MyAPIProfile.json


Export all API Profiles

curl -X GET -o MyAPIProfile.json -u user:password https://<InstanceAddress>/rest/v1/apiprofile/name/MyProfile/export

Import Multiple API Profiles

curl -X POST -u user:password "https://<InstanceAddress>/rest/v1/apiprofile/import" -H "Content-Type: application/json" --data-binary @MyAPIProfile.json



Exporting/Importing Files

Typically, API Profiles have multiple RSD files defining them. To discover the list of filenames for a given API Profile, use the /file endpoint as exampled below:

curl -X GET -o MyAPIProfile.json -u user:password https://<InstanceAddress>/rest/v1/apiprofile/name/MyProfile/file


A specific file can be then be included in the API path to perform many functions:

Deleting an RSD file

curl -X POST -o MyAPIProfile.json -u user:password https://<InstanceAddress>/rest/v1/apiprofile/name/MyProfile/file/name/MyRSD.rsd/delete

Exporting an RSD file

curl -X GET -o MyAPIProfile.json -u user:password https://<InstanceAddress>/rest/v1/apiprofile/name/MyProfile/file/name/MyRSD.rsd/export

​Note: There is no method for exporting all RSD files in an API Profile as this is akin to exporting the API Profile itself, which has been exampled further up this article.

 

Importing an RSD file

curl -X POST -u user:password https://<InstanceAddress>/rest/v1/apiprofile/name/MyProfile/file/name/MyRSD.rsd/import -H "Content-Type: application/json" --data-binary @MyAPIFile.json

​Note: There is no method for importing all RSD files in an API Profile as this is akin to importing the API Profile itself, which has been exampled further up this article.

 

Revert an RSD file

curl -X POST -u user:password https://<InstanceAddress>/rest/v1/apiprofile/name/MyProfile/file/name/MyRSD.rsd/revert

Note: RSD files are reverted to their default state as packaged with the Matillion ETL product. This means that only non-user-defined API Profiles may be reverted. Attempting to revert a user-defined API Profile will give an error and will not damage said API Profile.

 

 

Testing an API Profile

API Profiles can be tested via the API such as in the example below. The test will make a very limited API call to the service to evaluate the validity of the API Profile.

Note that many valid API Profiles are not expected to appear successful via this test, including many default Matillion ETL API Profiles, for example if the API Profile in question would require authentication to function. Meanwhile, some invalid API Profiles (such as ones that are empty) may appear successful as attempting nothing throws no error. As such, we suggest that users instead test API Profiles from within the Matillion ETL client and assess success based on the data returned.

curl -X GET -o MyAPIProfile.json -u user:password https://<InstanceAddress>/rest/v1/apiprofile/name/MyProfile/test