Index



Introduction

The LawPanel API is REST based and uses built-in HTTP features like HTTP verbs, headers and query parameters.

All payloads are JSON objects. JSON is returned by all API responses including errors.

If you are doing a special development for our API please contact us for access to the development/test enviroment.


Authentication

Authentication consists of two separated identification levels:


  • Firm level: Identify your firm account including your secret API key in the request with the parameter/header: subscription-key. Please do not share this key as it's for your company only. You can find your API key on "Your Setup" page. This level is required to perform simple tasks where is not necessary to identify the user.

    For example, to read IPO registries you can perform a GET HTTP call: https://api.lawpanel.com/v1/firms/registries?subscription-key=[Your subscription key]


  • User level: This authentication level is required by the most methods where, due to the action nature, the API needs to know the identity of the user performing it.

    For example, to create a trademark search, you must be identified at the user level.

    Authentication at this level is performed with an HTTP cookie named .LawPanel.AuthCookie and you must include it with all requests.

    To identify as a user and obtain the cookie you should call the account login method.


All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.


Pagination and Filtering

All top-level API resources have support for bulk fetches and ordering via "Read many" API methods and share a common structure taking these parameters: skip, take, filter_id, filter_definition.

For example, you can read registries, read search classes, and read trademark searches and define differents values for these parameters.

  • LawPanel syntax

    With this syntax you can include these parameters:

    Name Type Description Default Required
    skip integer

    The skip parameter omits the specified number of returned records, starting always from the first record.

    0 Optional
    take integer

    The take parameter controls how many records the API returns.

    If you use it with the skip parameter, the first record returned will be at the position skip+1.

    If the skip parameter does not exist, it returns the first records.

    If you do not specify this value, the default value is 10.

    Max value allowed for take is 100.

    10 Optional
    filter_id string

    The filter_id applies a filter to the endpoint. Filters are the mechanism to select sub-sets of data from endpoints.

    Like any other entity, filters can be created, read on details, read as many, updated, and deleted.

    Basically, endpoints with a Read many method also have a /filters method. This /filters method gives you detailed information about what properties are available to create and apply a filter.

    For example, you can check /filters methods for trademarks, registries, trademark searches, etc.

    Check create method for filters in order to obtain more details about how to create the structure required for your query.

    null Optional
    filter_definition string

    The filter_definition parameter applies a filter definition on a Read many method. It's aimed to allow you select sub-sets of data from endpoints without create a new filter.

    Endpoints with a Read many method also have a /filters method. This /filters method gives you detailed information about what properties are available to create and apply a filter.

    For example, you can check /filters methods for trademarks, registries, trademark searches, etc.

    For example, if you want to filter trademarks showing only trademarks with Denmark as registry, a minimun filter_definition will be similar to this one: {"groups":[{"expressions":[{"property_name":"registry.id","comparator":"==","value":"30fdc95d-8e2e-4051-924b-a835017ea5b8"}]}]}

    Check create method for filters in order to obtain more details about how to define the filter structure required for your query.

    If parameter filter_id already exists, filter_definition will be ignored.

    null Optional

    Responses from Read many methods, can contain following values in the HTTP headers:

    Name Type Description
    Total integer

    Contains the total of entities without any kind of filters.

    Filtered integer

    Only exists if you are including filter_id or filter_definition parameters. Shows the total of entities for this reponse with the filter applied.

    Current integer

    Shows how many entities are returned with current response.

    Taken integer

    Shows the value for take parameter.

    Skipped integer

    Shows the value for skip parameter.

  • DataTables syntax

    You can also connect "Read many" endpoints with a DataTable table to show data in a easy way.

    For example, using this HTML div:

    <table id="datatablesSample"></table>
    

    With this piece of JavaScript+JQuery code:

    <script>
    $(document).ready( function () {
    	$('#datatablesSample').DataTable({
    		ajax: {
    			url: 'https://api.lawpanel.com/v1/public/registries?subscription-key=11f6748ffeaa495db184334adb721cf1',
    			type: "GET",
    			dataType: "jsonp",
    			contentType: "jsonp",
    			dataSrc: 'data',
    			data: function (entity) {
    				entity.use_datatables_query_syntax = true;
    				entity.is_jsonp = true;
    				}
    		},
    		serverSide: true,
    		aoColumns: [
    			{ title: "id", data: "id", visible: false  },
    			{ title: "Wipo code", data: "wipo_code"    },
    			{ title: "Description", data: "description"},
    			{ title: "With data", data: "have_data"    },
    			{ title: "Total trademarks", data: "total_trademarks"}
    		]	
    	});
    } );
    </script>
    

    You'll get this 100% functional table with ordering, filtering and pagination: