def block(keyset_id, block_id=None):
    """Provide endpoint to get block information.

    Endpoint allow to retrieve information about specific block or all
    blocks registered for keyset (if 'block_id' is 'None').
    :type keyset_id:  int
    :param keyset_id: Reference on unique identifier of application's
                      keyset for which list of blocks should be retrieved.
    :type block_id:   int | None
    :param block_id:  Reference on unique identifier of block for which
                      information should be retrieved.

    :rtype:  str
    :return: Target REST API endpoint which is relative to base address.
    """
    endpoint = '/v1/blocks/key/{0}/block'.format(keyset_id)
    if block_id:
        endpoint = '{0}/{1}'.format(endpoint, block_id)
    return endpoint
