GET
/
v1
/
oauth2
package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.Oauth2.Clients.List(ctx, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.ListResourceOAuth2Client != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}
{
  "items": [
    {
      "redirect_uris": [
        "<string>"
      ],
      "token_endpoint_auth_method": "client_secret_post",
      "grant_types": [
        "authorization_code",
        "refresh_token"
      ],
      "response_types": [
        "code"
      ],
      "scope": "openid profile email user:read organizations:read organizations:write custom_fields:read custom_fields:write discounts:read discounts:write checkout_links:read checkout_links:write checkouts:read checkouts:write products:read products:write benefits:read benefits:write events:read events:write meters:read meters:write files:read files:write subscriptions:read subscriptions:write customers:read customers:write customer_sessions:write orders:read refunds:read refunds:write metrics:read webhooks:read webhooks:write external_organizations:read license_keys:read license_keys:write repositories:read repositories:write issues:read issues:write customer_portal:read customer_portal:write",
      "client_name": "<string>",
      "client_uri": "<string>",
      "logo_uri": "<string>",
      "tos_uri": "<string>",
      "policy_uri": "<string>",
      "created_at": "2023-11-07T05:31:56Z",
      "modified_at": "2023-11-07T05:31:56Z",
      "client_id": "<string>",
      "client_secret": "<string>",
      "client_id_issued_at": 123,
      "client_secret_expires_at": 123
    }
  ],
  "pagination": {
    "total_count": 123,
    "max_page": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

page
integer
default:
1

Page number, defaults to 1.

Required range: x > 0
limit
integer
default:
10

Size of a page, defaults to 10. Maximum is 100.

Required range: x > 0

Response

200
application/json
Successful Response
items
object[]
required
pagination
object
required

Was this page helpful?