--- title: "STEP 3: Get a refresh token (o365-audit-logs)" slug: "step-3-get-a-refresh-token" updated: 2026-03-17T11:10:28Z published: 2026-03-17T11:10:28Z canonical: "docs.hunters.ai/step-3-get-a-refresh-token" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.hunters.ai/llms.txt > Use this file to discover all available pages before exploring further. # STEP 3: Get a refresh token (o365-audit-logs) In this process you will use the values retrieved in the previous steps, to generate a refresh token. The refresh token is required when setting up the connection on Hunters. **To generate a refresh token:** 1. Open your terminal and run the following command after replacing the **{client_id}**, **{client_secret}** and **{authorization_code}** variables with the information collected in the previous steps: 2. ```bash curl -X POST \  -H "Content-Type: application/x-www-form-urlencoded" \  -d "code=AUTHORIZATION_CODE" \  -d "client_id=CLIENT_ID" \  -d "client_secret=CLIENT_SECRET" \  -d "redirect_uri=http://localhost:5110" \  -d "grant_type=authorization_code" \  -d "scope=https://manage.office.com/ActivityFeed.Read" \  https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/token ``` An **access token** and a **refresh token** will be returned. 3. Copy and paste both values into a notepad for future use: - **Access token** - use it in the next steps to start subscriptions (if required). - **Refresh token** - use it when setting up the connection on the Hunters platform.