public function create($imageUrl, $boardId, $description = '', $link = '', $title = '', $sectionId = null)
    {
        // Upload image if first argument is a local file
        if (file_exists($imageUrl)) {
            $imageUrl = $this->upload($imageUrl);
        }

        $requestOptions = [
            'method' => 'scraped',
            'description' => $description,
            'link' => $link,
            'image_url' => $imageUrl,
            'board_id' => $boardId,
            'title' => $title,
        ];

        if ($sectionId !== null) {
            $requestOptions['section'] = $sectionId;
        }

        $this->post(UrlBuilder::RESOURCE_CREATE_PIN, $requestOptions);

        return $this->response->getResponseData();
    }
public function create($imageUrl, $boardId, $description = '', $link = '', $title = '', $sectionId = null)
    {
        // Upload image if first argument is a local file
        if (file_exists($imageUrl)) {
            $imageUrl = $this->upload($imageUrl);
        }

        $requestOptions = [
            'method' => 'scraped',
            'description' => $description,
            'link' => $link,
            'image_url' => $imageUrl,
            'board_id' => $boardId,
            'title' => $title,
        ];

        if ($sectionId !== null) {
            $requestOptions['section'] = $sectionId;
        }

        $this->post(UrlBuilder::RESOURCE_CREATE_PIN, $requestOptions);

        return $this->response->getResponseData();
    }
public function create ( $ imageUrl , $ boardId , $ description = '' , $ link = '' , $ title = '' , $ sectionId = null ) { // Upload image if first argument is a local file if ( file_exists ( $ imageUrl ) ) { $ imageUrl = $ this -> upload ( $ imageUrl ) ; } $ requestOptions = [ 'method' => 'scraped' , 'description' => $ description , 'link' => $ link , 'image_url' => $ imageUrl , 'board_id' => $ boardId , 'title' => $ title , ] ; if ( $ sectionId !== null ) { $ requestOptions [ 'section' ] = $ sectionId ; } $ this -> post ( UrlBuilder :: RESOURCE_CREATE_PIN , $ requestOptions ) ; return $ this -> response -> getResponseData ( ) ; }
Create a pin. Returns created pin info.

@param string $imageUrl
@param int $boardId
@param string $description
@param string $link
@param string $title
@return array
Create a pin . Returns created pin info .