- User boards
- Current user boards
- Board info
- Create
- Update
- Delete
- Follow/unfollow
- Board pins
- Board followers
- Title suggestions
- Send via message/email
- Board sections
- Invites
Get all user's boards:
$boards = $bot->boards->forUser($username);
Get all current logged-in user's boards.
$boards = $bot->boards->forMe();
Get full board info by boardName and userName. Here you can get board id, for further functions (for example, pin creating or following boards):
$info = $bot->boards->info($username, $board);
Create a new board:
// Create a public board
$bot->boards->create('Name', 'Description');
// Create a private board
$bot->boards->createPrivate('Name', 'Description');
Update a board by id:
$bot->boards->update($boardId, ['name' => 'New title', 'description' => 'New description']);
You can pass more options in update: 'privacy' - is public by default and 'category' - is other by default:
$bot->boards->update($boardId, [
'name' => 'New title',
'description' => 'New description',
'privacy' => 'secret',
'category' => 'sports',
]);
Delete a board by id:
$bot->boards->delete($boardId);
Follow/unfollow board by id:
$bot->boards->follow($boardId);
$bot->boards->unfollow($boardId);
Get all pins for board by id (returns Pagination object):
foreach ($bot->boards->pins($boardId) as $pin) {
// ...
}
Get board followers. Uses pinterest api pagination (returns Pagination object):
foreach($bot->boards->followers($boardId) as $follower) {
// ...
}
When you repin, Pinterest suggests you some board titles for it. You can get these suggestions for pin by its id:
$suggestions = $bot->boards->titleSuggestionsFor($pinId);
Send board with message or by email:
// Send board with message
$bot->boards->sendWithMessage($boardId, 'Message', $userId); // To a user
$bot->boards->sendWithMessage($boardId, 'Message', [$userId1, $userId2]); // To many yusers
// Send board by email
$bot->boards->sendWithEmail($boardId, 'Message', 'friend@example.com'); // One email
$bot->boards->sendWithEmail($boardId, 'Message', ['friend1@example.com', 'friend2@example.com']); // many
Every board can have several sections. Get a list of sections for a specified boardId. Returns an array of sections data.
$sections = $bot->boardSections->forBoard($boardId);
Create a section for a board:
$bot->boardSections->create($boardId, 'Section name');
Update a section's name. You need a section id, which can be retrieved by calling $bot->boardSections->forBoard($boardId)
:
$bot->boardSections->update($sectionId, 'New section name');
Delete a section. You need a section id, which can be retrieved by calling $bot->boardSections->forBoard($boardId)
$bot->boardSections->delete($sectionId);
Get all your active boards invites:
$invites = $bot->boards->invites();
Get invites for a specified board, including accepted and declined invites (returns Pagination object):
foreach($bot->boards->invitesFor($boardId) as $invite) {
// loop through invites
}
Invite someone to your board:
// to a user by email
$bot->boards->sendInvite($boardId, 'someone@example.com');
// to a user by user id
$bot->boards->sendInvite($boardId, $userId);
// to users by email
$bot->boards->sendInvite($boardId, ['someone@example.com', 'somefriend@example.com']);
// to users by user id
$bot->boards->sendInvite($boardId, [$user1Id, $user2Id]);
Accept an invite to a board:
$bot->boards->acceptInvite($boardId);
Ignore an invite to a board:
$bot->boards->ignoreInvite($boardId);
Delete invite. Removes from the board collaborators, requires an id of the user, you want to remove from the board:
$bot->boards->deleteInvite($boardId, $userId);
// also you can ban a user specifying third argument as true
$bot->boards->deleteInvite($boardId, $userId, true);
Leave a board you have been invited to:
$bot->boards->leave($boardId);