Authentication

How to authenticate with the Daylite API using OAuth 2.0 or a personal token.

The Daylite API uses OAuth 2.0 for authentication. If you're just getting
started or building something for your own account, the quickest path is a
personal token — no app registration required.

If you're building an integration that other Daylite users will authorize
through your app, you'll need to register an OAuth application. Follow the
steps below to get set up.

Getting Started with OAuth

Step 1: Register your application

To register a new application, fill out the App Registration form. We will need the following information from you:

FieldDescription
Application nameName of your application
Application identifierA reverse DNS style identifier, like com.mycompany.mygreatdayliteapp
OrganizationThe name of the organization affiliated with your app
Support emailAn email address users of your app can contact for support
Requested ScopesList of requested OAuth scopes. See the OAuth Scopes table below
Redirect URLsURLs where the user will be redirected after authorization is complete

OAuth Scopes

daylite:readRead access to all Daylite data
daylite:writeWrite access to all Daylite data

Step 2: Authenticate the user

The authentication is an OAuth 2.0 flow — the user signs in with their Marketcircle credentials, authorizes your app to access Daylite, and your app receives a code it can exchange for an access token.

See the OAuth 2.0 RFC section 1.2 to learn more about the authentication flow.

OAuth 2.0 Endpoints

EndpointDescriptionRequired Parameters
https://www.marketcircle.com/account/oauth/authorizePage where the user authorizes your application to access Daylite dataQuery Parameters

- client_id — the identifier of your application
- redirect_uri — URL where the user will be redirected after authorization
- scopes (optional) — must be a subset of the scopes requested during registration
https://www.marketcircle.com/account/oauth/tokenExchange an authorization_code or refresh_token for an access_tokenx-www-form-urlencoded body in POST with

- client_secret — your client secret
- refresh_token or authorization_code

Step 3: Refresh your token

Access tokens expire after 1 hour. Your app should store the refresh_token securely and use it to obtain a new access_token when needed. See Refresh Token for details.