Giter Site home page Giter Site logo

lawpanel / apiclient.dotnet Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 2.0 226 KB

Typed .NET client for lawpanel.com REST APIs

Home Page: https://developer.lawpanel.com

C# 100.00%
law trademark-management lawyer attorneys-general api intellectual-property trademarks

apiclient.dotnet's Introduction

Logo and name

Build

This project contains a Portable Class Library containing a typed .NET client gateway for accessing LawPanel's Firms REST API.

Features

  • Small, typed, message-based API uses only clean DTO's
  • Portable profile available supporting .NET 4.5, ASP.NET Core 1.0, Windows 8, Xamarin.Android, Xamarin.iOS clients

Install LawPanel.ApiClient.DotNet

Install from NuGet with:

PM> Install-Package LawPanel.ApiClient.DotNet

Includes Portable Version (.NET 4.5, ASP.NET Core 1.0, Windows 8, Xamarin.Android, Xamarin.iOS)

Usage

Requires a registered LawPanel API Key, e.g:

var lawpanel = new LawPanelClient("8a5536dc-6d34-4f4a-8cac-a67201481ca0");

Some API methods requires, in addition to the API Key, the authentication at level user.

So, you can call the constructor as below:

var lawpanel = new LawPanelClient("8a5536dc-6d34-4f4a-8cac-a67201481ca0","[email protected]","password");

Request and return DTO's are just clean POCO's, e.g:

public class SearchDto : Dto, IIdentifiableDto
{
  public string               Id          { get; set; }
  public string               SearchTerm  { get; set; }
  public string               Classes     { get; set; }
  public DateTime             StartTime   { get; set; }
  public DateTime             EndTime     { get; set; }
  public int                  Score       { get; set; }
  public string               Weightings  { get; set; }
  public SearchType           Type        { get; set; }
  public TrademarkRegistry    Registry    { get; set; }
  public SearchStatus         Status      { get; set; }
  public string               StatusText  { get; set; }
}

Documentation

These API examples follows LawPanel's Firm API Documentation.

Pagination

If you are getting lists of entities using the READ methods (i.e. ReadSearchClasses) can filter results using the optional parameters skip and take.

By example, to skip the first 5 search classes and get the next 10:

var searchClasses = lawpanel.ReadSearchClasses(5, 10);

If you do not specify these parameters, will receive all entities: the API client will execute all calls required to get all entities.

Ordering

You can set the order for the results specifying the field names and the order direction. By example:

var searchClasses = lawpanel.ReadSearchClasses(order: new List<ColumnOrder> { 
  new ColumnOrder { Name = "name", Direction = OrderDirection.Desc } 
});

Will returns all search classes ordered by the field name in descending ordering.

Important: all field names should be writen with the snake_case convention.

By example, if the field name is Name should be name, if it is SearchClasses you should write it as search_classes, etc.

Examples

Creating a new trademark search

var search = lawpanel.CreateSearch(new SearchQuery
{
    Classes = "3,25,15",
    Registry = "UK",
    SearchTerm = "lawpanel"
});

Retrieving a Search status

var searchStatus = lawpanel.GetStatus(search.Id);

apiclient.dotnet's People

Contributors

chapeti avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.