Skip to content

Folders

Csaba Okrona edited this page Oct 6, 2020 · 2 revisions

Instapaper's folders API

Read more at the official Instapaper API docs page

Operations

List

svc := instapaper.FolderService{
			Client: apiClient,
		}
		folderList, err := svc.List()

This returns a slice of Folder:

type Folder struct {
	ID           json.Number `json:"folder_id"`
	Title        string
	Slug         string
	DisplayTitle string `json:"display_title"`
	SyncToMobile int    `json:"sync_to_mobile"`
	Position     json.Number
}

!!!Only returns user-created folders, none of the default ones!!!

Add

Add requires a string title to create a new user-level folder. The title needs to be unique, otherwise, an error is returned. It returns the created Folder.

folder, err := svc.Add("Totally unique folder name I swear")

Delete

Delete removes a folder and moves all of its bookmark entries to the archive. It requires a Folder ID as a parameter.

err := svc.Delete("123456")

SetOrder

SetOrder sets the order of the user-created folders.

Format: folderid1:order1,folderid2:order2,...,folderidN,orderN ; example: 100:1,200:2,300:3

The order of the pairs in the list does not matter. You should include all folders for consistency.

Returns the new folder list.

!!!No errors returned for missing or invalid folders!!!

folderList, err = svc.SetOrder("123456:1,67894:2")