seregazhuk / php-pinterest-bot

This PHP library will help you to work with your Pinterest account without using any API account credentials.
MIT License
413 stars 129 forks source link

Get all invated user's my board #403

Closed ug-code closed 6 years ago

ug-code commented 6 years ago

hi

I use this method

$bot->boards->sendInvite($boardId, $userId);

How can I see who I have already invited to board ?

maybe the code should be like this:

if($bot->boards->isInvited($boardId, $userId)){
    $bot->boards->sendInvite($boardId, $userId)
}
or 

$bot->boards->getInvited($boardId, $userId)
seregazhuk commented 6 years ago

Hi! Pinterest returns the following response:

2018-07-27 21 30 07

I can add something like

$invites = $bot->boards->getInvites($boardId);

and then the calling code can take what it needs from this response. What do you think about this?

ug-code commented 6 years ago

yes, this is what I want. Thank you :blush:

seregazhuk commented 6 years ago

Use this method:

$bot->boards->invites()

I think it is what you need.

ug-code commented 6 years ago

this is different code => $bot->boards->invites()

I invite people to join my board

I use this method

$bot->boards->sendInvite($boardId, $userId);

If $userId already exists in the board ,it should not send invite :(

you should add something like $invites = $bot->boards->getInvites($boardId); //:P

image

Request URL: https://tr.pinterest.com/resource/BoardInvitesResource/get/
source_url: /example-username/Example-boardname/
data: {"options":{"bookmarks":["b28zMDB8MmViNWViMjg0NjIwYTUxNWMzNTQwYmNlMjFmMDFiNjhmZGVhYWE0NTU1MDhlNmFkZjBkOWY4MTYwNjhlZWIzYw=="],"board_id":"313422524006965473","field_set_key":"boardEdit","status_filters":"new,accepted,contact_request_not_approved","sort":"viewer_first","include_inactive":true},"context":{}}
_: 1533053377052

pinterest response below picture image

seregazhuk commented 6 years ago

@ug-code oh I see. Update to version v5.8.1 and use this code:

foreach($bot->boards->invitesFor($boardId) as $invite) {
    // loop through invites
}

I've updated the docs.

Hope it works 😉

ug-code commented 6 years ago

it works fine. :+1: Thank you @seregazhuk