Giter VIP home page Giter VIP logo

plangrid-api-net's Introduction

PlanGrid .NET SDK for the public PlanGrid API

To install, use the Nuget package:

Install-Package PlanGrid.Api

Details API Docs

For the fullblown documentation, head on over to our developer site. There you can get a description of every endpoint at your disposal and also an explanation of basic concepts such as authentication and how to get an API token.

Getting Started

Once installed, to access the api, simply use PlanGridClient.Create(). However, you will need to provide your API key to gain access. There are three ways to provide the key. The simplest is to pass it directly as an argument to Create:

IPlanGridApi api = PlanGridClient.Create("yourApiKey");

This has the advantage of being straightforward, but has the disadvantage of baking the key into your code, which reduces security and makes it more difficult to update.

Alternatively, you can set the key in your App.config (or Web.config) file:

<appSettings>
    <add key="PlanGridApiKey" value="yourApiKey" />
</appSettings>

Ensure that you do not already have an <appSettings> node -- if you do, add the <add /> element to the existing one. When using this approach, you can create the client with the parameterless constructor:

IPlanGridApi api = PlanGridApiClient.Create();

Finally, you may set the key in an environment variable; the variable name must be PLANGRIDAPIKEY.

Getting a list of projects

Having provided the API key in one of the ways outlined above, you can now interact with the various endpoints available to you. To start, we'll simply get a list of projects:

Page<Project> projects = await api.GetProjects();

Some things to note:

  • This returns a paginated subset of all the projects to which you have access.
  • The default limit is 50 projects
  • To get the next 50, you'd pass 50 as the first argument (this value defaults to 0, implying that you want to start from the beginning).

To get the next 20 projects (after the first 50), you would call:

projects = await api.GetProjects(50, 20);

Copyright

Copyright © PlanGrid, Inc. MIT License; see LICENSE for further details.

plangrid-api-net's People

Contributors

bryegmoney avatar jpalawaga avatar juliusiv avatar kirkplangrid avatar marchello2000 avatar noahplangrid avatar viktoriyavulfson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plangrid-api-net's Issues

Unused type T in api.Upload<T>?

It appears the api.Upload< T >(api, fileUpload, payload) method requires a type T that is never used? It seems to work fine with just < object > but wasn't sure what it expected.

        var api = PlanGridClient.Create(Properties.Settings.Default.ApiKey);

        var versionRequest = new UploadVersionRequest
        {
            NumberOfFiles = 1,
            VersionName = "MyVersion" 
        };

        var versionUpload = await api.UploadVersion(project_uid, versionRequest);

        foreach (var fileUploadRequest in versionUpload.FileUploadRequests)
        {
            var uploadFile = new UploadFile
            {
                FileName = filename
            };

            var fileUpload = await api.UploadFileToVersion(project_uid, versionUpload.Uid, fileUploadRequest.Uid, uploadFile);

            await api.Upload<object>(fileUpload, payload);  // what type is expected here???
        }

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.