Rotate Worksome keys
This guide will walk you through how to rotate Worksome keys on Luna.
Introduction
Worksome is our affiliate management system. We can create affiliates in the following manner.
- Manage affiliates in Worksome. When they sign a contract, Luna receives a webhook and creates the affiliate. Affiliates synced with Worksome are tagged as worksome in Luna. They should be managed via Worksome
- Manually create affiliates in Luna which can be nearshore or other.
We have 2 integrations with Worksome. The first one is webhook integration to receive various events. The second integration is using API keys / bearer tokens to call worksome APIs to fetch additional information like agency fees when processing webhooks
The integration keys and secrets are saved in parameter store. Search for worksome to find the exact name. To set up Worksome API keys there are 2 different links for sandbox and production environments which are mentioned below
You need to be a Worksome administrator in order to set or revoke secrets / tokens. The integration secrets / tokens generated here need to be saved in parameters in AWS.
Webhook Integration
Worksome webhook integration works at organisation level. Worksome has set up three organisations for us - UK, NL and US for our UK, NL and US businesses.
Here's how to set up or edit a webhook:
Access the organisations, log in to Worksome using below links
Click on the bottom left icon to bring up the menu and click on the relevant Team menu to switch between teams. The default is UK

- When you are in the relevant Team, click on the Integrations menu item to the bottom left of the screen, under the Company section

- You will see the team specific webhook section.

- Click on create webhook or 3 dots to edit webhook. It brings up the webhook window.

- When creating a webhook you will have to generate a unique secret which you can do via a random string generator. Save this in the parameter store for each organisation. The url will be
<base_url>/webhooks/worksomewhere base_url is the base URL of the Luna environment you are integrating the webhook.
API Integration / Bearer Token
- In any of the team specific webhook sections, select the API Tokens button to the top right. The API Tokens page is universal, applying to all teams at the company level.

- You will see the API Token page. Any existing bearer token entries automatically expire and removes themselves every 6 months.

- Click on Create Token, name it to generate the bearer token details. You will need to save this in the worksome api token records in parameter store

Note on Production Access
The Luna team has access to production environments under luna@and.digital email. Get in touch with a team member who has access to 1Password and can share you access to the Okta and Worksome logins to enter Worksome's production environment.
