This guide assumes you've already done the following:
An integration contains the access tokens which are issued by the 3rd-party service and allow Work-API to access those servies on behalf of a user.
In order to make requests on behalf of the developer, credentials must be entered via the Dashboard which allow Work-API to identify as the developer when making calls to the underlying APIs.
When setting up the OAuth credentials on the underlying provider, the Work API OAuth callback URI must be provided as a redirect. Failure to do so will mean users are not able to add integrations.
The Work API OAuth2 redirect URI is:
For information on adding API credentials to the Work API, see Create an Environment
Once a set of credentials is stored in the WorkAPI database, the user can then connect their accounts to the system.
The first step is to create an integration via the API.
token = "<user token>" client = LivilApi::Service.new(token) provider = 'gmail' media_type = 'email' integration = LivilApi::Integration.new(provider: proivder, media_type: media_type) created_integration = client.create_integration(integration: integration) created_integration # => LivilApi::Integration(provider: 'gmail', media_type: 'email', ...)