src/SemaphoreClient.php
public function messages( $options )
    {

    	$params = [
            'query' => [
	            'apikey' =>  $this->apikey,
	            'limit' => 100,
                'page' => 1
            ]
        ];

		//Set optional parameters
	    if( array_key_exists( 'limit', $options ) )
	    {
		    $params['query']['limit'] = $options['limit'];
	    }

	    if( array_key_exists( 'page', $options ) )
	    {
		    $params['query']['page'] = $options['page'];
	    }

        if( array_key_exists( 'startDate', $options ) )
        {
        	$params['query']['startDate'] = $options['startDate'];
        }

	    if( array_key_exists( 'endDate', $options ) )
	    {
		    $params['query']['endDate'] = $options['endDate'];
        }

	    if( array_key_exists( 'status', $options ) )
	    {
		    $params['query']['status'] = $options['status'];
        }

	    if( array_key_exists( 'network', $options ) )
	    {
		    $params['query']['network'] = $options['network'];
	    }

	    if( array_key_exists( 'sendername', $options ) )
	    {
		    $params['query']['sendername'] = $options['sendername'];
	    }

	    $response = $this->client->get( 'messages', $params );
        return $response->getBody();
    }
public function messages( $options )
    {

    	$params = [
            'query' => [
	            'apikey' =>  $this->apikey,
	            'limit' => 100,
                'page' => 1
            ]
        ];

		//Set optional parameters
	    if( array_key_exists( 'limit', $options ) )
	    {
		    $params['query']['limit'] = $options['limit'];
	    }

	    if( array_key_exists( 'page', $options ) )
	    {
		    $params['query']['page'] = $options['page'];
	    }

        if( array_key_exists( 'startDate', $options ) )
        {
        	$params['query']['startDate'] = $options['startDate'];
        }

	    if( array_key_exists( 'endDate', $options ) )
	    {
		    $params['query']['endDate'] = $options['endDate'];
        }

	    if( array_key_exists( 'status', $options ) )
	    {
		    $params['query']['status'] = $options['status'];
        }

	    if( array_key_exists( 'network', $options ) )
	    {
		    $params['query']['network'] = $options['network'];
	    }

	    if( array_key_exists( 'sendername', $options ) )
	    {
		    $params['query']['sendername'] = $options['sendername'];
	    }

	    $response = $this->client->get( 'messages', $params );
        return $response->getBody();
    }
Retrieves up to 100 messages, offset by page
@param array $options ( e.g. limit, page, startDate, endDate, status, network, sendername )
@return StreamInterface
@internal param null $page - Optional page for results past the initial 100