authcu

package module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

README

Purpose

Package provides simplified OAuth 2.0 key exchange for Clickup API v2. Please note that Clickup's access keys do not expire, there is no refresh token implementation.

Setup

  1. Create new application in Clickup > Settings > Integrations > Clickup API. Define the redirect URL, i.e. http://localhost:4321 for example below.
  2. Set the client id and secret from the Clickup API App UI as env variables and define in your Go project:
var (
	clientID     = os.Getenv("CLICKUP_CLIENT_ID")
	clientSecret = os.Getenv("CLICKUP_CLIENT_SECRET")
	redirectURL  = "https://localhost:4321"
)

Usage

  1. Use the provided function: GetAccessToken(clientID, clientSecret, redirectURL) which returns variable AccessToken
  2. To request data from ClickUp API provide request with following header data to the appropriate Clickup API URL:
    req.Header.Add("Authorization", tokenValue)
    req.Header.Add("Content-Type", "application/json")
    req.Header.Add("X-API-Key", clientID)
    

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCUToken

func GetCUToken(clientID, clientSecret, localHostPort string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL