-
Notifications
You must be signed in to change notification settings - Fork 3
Folders
Csaba Okrona edited this page Oct 6, 2020
·
2 revisions
Read more at the official Instapaper API docs page
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 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 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 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")