Integrations
The integrations
API lets you build plugins integrating third party API services into Qatium. The integrations API allows to fetch HTTP requests through Qatium’s gateway, and manage user secrets for authentication, and other uses.
The integrations.secrets
API lets you store and retrieve secret data for users and networks. Storing these secrets let users configure all required credentials for API integrations, such as usernames and passwords, API keys, API URLs, etc.
Secrets are being stored safely in Qatium’s infrastructure, ensuring privacy and confidentiality.
Fetch API
fetch()
Performs a HTTP fetch proxied through Qatium’s API integration gateway. Behaves in the same way as the built in fetch() method. Check the fetch method documentation to know more.
Resolves to no-op when running in developer mode unless your developer account is approved by Qatium to do third party API integrations
Using secrets
The fetch API works in combination with the Secrets API, to provide a secure way of integrating with third party APIs.
You can use the stored secrets in the API requests using the format $(secret:SECRET_KEY)
being SECRET_KEY
the name of
the secret stored.
You can find an example of how to combine secrets in API integrations in this example.
Parameters
input
: URL as string, URL Object or Request object
init
: (Optional) HTTP request options
Returns
Promise resolving with the HTTP response
Example
Perform a request to a third party API:
Perform a request to a third party API using secrets:
Secrets
secrets.get()
Returns a secret value by name.
Resolves to no-op when running in developer mode unless your developer account is approved by Qatium to do third party API integrations
Method signature
Parameters
key
: Secret name.
Returns
A promise which will resolve after the secret value is retrieved from Qatium’s infrastructure. If the secret does not exist or an error raises, an empty string will be returned (""
).
Example
secrets.has()
Returns whether a secret exists by name.
Resolves to no-op when running in developer mode unless your developer account is approved by Qatium to do 3rd party API integrations
Method signature
Parameters
key
: Secret name.
Returns
A promise which will resolve after verifying whether the secret exists in Qatium’s infrastructure. If the secret does not exist or an error raises, false
will be returned.
Example
secrets.set()
Sets the value for a secret by key.
Resolves to no-op when running in developer mode unless your developer account is approved by Qatium to do third party API integrations
Method signature
Parameters
key
: Secret name.
value
: Secret value.
Returns
A promise which will resolve after the secret value has been updated. The returned value informs whether the operation has succeeded or failed.