php-pinterest-bot
php-pinterest-bot copied to clipboard
if board exist return board id else create function
How can?
public function create($name, $description, $privacy = self::BOARD_PRIVACY_PUBLIC) { $requestOptions = [ 'name' => $name, 'description' => $description, 'privacy' => $privacy, ]; return $this->post(UrlBuilder::RESOURCE_CREATE_BOARD, $requestOptions); }
this function should be return a created board id.
Since the generated board ID does not give, we have to search the boards of the account again.
I can find out if there is a board or not, but when I try to create a new board, it doesn't give me the board id.
In fact, the simplest may be.When using the Create function, if the board name already exists, give it its id.If not, let it create and give id.
@oguzdelioglu have you ever checked the endpoint? What is the response of board create endpoint? Could you please share if you have