seregazhuk\PinterestBot\Api\Response::getResponseData PHP Method

getResponseData() public method

Check if specified data exists in response.
public getResponseData ( null $key = null ) : array | boolean
$key null
return array | boolean
    public function getResponseData($key = null)
    {
        if ($this->hasErrors()) {
            return false;
        }
        return $this->parseResponseData($key);
    }

Usage Example

 /** @test */
 public function it_should_return_false_on_error_response()
 {
     $response = new Response();
     $response->fill($this->createErrorApiResponse('some error'));
     $this->assertFalse($response->getResponseData());
     $lastError = $response->getLastError();
     $this->assertEquals('some error', $lastError['message']);
 }
All Usage Examples Of seregazhuk\PinterestBot\Api\Response::getResponseData