-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Csaba Okrona edited this page Oct 6, 2020
·
5 revisions
Instapaper's API uses OAuth v1a. If you want to access the full API, you need two things:
- OAuth client credentials (a client ID and a client secret) - you need to request them here.
- Your username (usually your email address) and password for Instapaper.
You can pin the version in go.mod: github.com/ochronus/instapaper-go-client v1.0.0
You can instantiate a new client like this:
import "github.com/ochronus/instapaper-go-client/instapaper"
.
.
.
apiClient, err := instapaper.NewClient("YOUR CLIENT ID", "YOUR CLIENT SECRET",
"YOUR INSTAPAPER EMAIL ADDRESS", "YOUR INSTAPAPER PASSWORD")
Once you have a client instance, the next thing you need to do is authenticate against Instapaper's API so the client gets the tokens it needs to call any of the endpoints:
authErr := apiClient.Authenticate()
Without this, all calls will return an error immediately.