Giter VIP home page Giter VIP logo

apidocs's Introduction

The Grid API documentation

Documentation for the public APIs of The Grid.

The latest built version is at developer.thegrid.io

For corrections, improvements file issues or pull requests in the the-grid/apidocs on Github.

Commandline tools

Several code examples are available as command-line tools, and can be useful for scripting, testing or development. You will need to have node.js installed.

To install

npm install -g thegrid-apidocs

Examples:

thegrid-authenticate             # get a The Grid user token, for use with the other tools

thegrid-share-file myfile.jpg    # share a file on disk to The Grid
thegrid-share-url http://coolblog.org/nifty.html                 # share article
thegrid-share-url http://myoldsite.com/article.html nocompress   # import all content of URL

thegrid-site-configure http://mygridsite.com colors   # show site config (here for colors)
thegrid-site-configure http://mygridsite.com name "My new name"   # set site config (here website title)

Schemas

In addition to the human-readable documentation, a set of JSON Schemas are provided. These can can be used to validate payloads, generate test-cases etc.

You can install or depend on these using NPM

npm install thegrid-apidocs

JavaScript validation example (using tv4 library)

var tv4 = require('tv4');
var apidocs = require('thegrid-apidocs');

var myPost = ....
var postSchema = apidocs.getSchema('item');
var valid = tv4.validate(myPost, postSchema);

Blueprints

The descriptions of HTTP APIs are using Blueprint found in ./blueprint. These are human-readable but can also be used to set up mock servers etc using the various tools that consume Blueprint.

Tests & examples

The schemas are tested for correctness using data-driven tests. Each of the valid and invalid ./examples, creates a testcase which ensures that the schema classifies it correctly.

The same examples are referenced in the Blueprint docs.

apidocs's People

Contributors

automata avatar bergie avatar cbchouinard avatar forresto avatar greenkeeperio-bot avatar jemgold avatar jonnor avatar matdube avatar paulyoung avatar svetly avatar

Stargazers

 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

Watchers

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

apidocs's Issues

User schema

I'd love to get a clear picture of the current User schema for requests made to https://api.thegrid.io/user.

The only documentation I can find is for https://passport.thegrid.io/api/user which has significantly less properties than the JSON response I'm seeing.

I'm hesitant to share what properties are present since I'm not sure if I have anything "special" due to being on staff at The Grid.

All I need for each property is its name, type, and if its required.

Please help!

Schema definitions should be linked or inlined in HTML docsform

Right now we just raw-dump the schemas into the blueprint. This is useful-ish, but things like $ref: someother-schema is confusing.

References should be resolved, and then put links into the HTML to navigate up/down between these. For single base definitions (which are usually very short) it might be nicer to inline.
Also, there should probably be a link to the schema itself (in .yml and .json format), so people see where it comes from.

Came up in #26

Updating user information

I think the information on updating users is unclear.

"required" suggests that email address must be provided whenever an update is made. Is that only the case if the email address is being updated?

If I'm interpreting the User schema correctly, email address is not required and may not be present in order to send back in a PUT request anyway.

POST and PUT responses

Some endpoints are documented as returning the new/updated resource (as is conventional) when making a POST or PUT request, but others aren't.

Is the documentation incorrect?

Creating a (fully configured) site

Am I correct in thinking that it's not possible to create a fully configured site in a POST request?

That is, with more than just the name and repo fields but also including site configuration data.

It seems as if a site must first be created and then configured via a PUT request.

/site endpoint response out of date

[{
    "id": "81ef58f5-e1de-4b20-b510-a7bc029c06d8",
    "url": "https://thegrid.ai/a-slightly-longer-site-name/",
    "name": "A Slightly Longer Site Name",
    "repo": "the-domains/a-slightly-longer-site-name",
    "domain": null,
    "path": null,
    "owner": "368c03f5-XXXX-XXXX-XXXX-58fd788912e2",
    "favlogo": null,
    "collaborators": [],
    "created_at": "2015-05-07T20:08:53.828Z",
    "updated_at": null
},

Site navigation

There's no easy way to get back to the home page or other site sections.

Roadmap access for Founding Members

I just got my beta-access and have been trying out the various tools. But I study computer information systems and would really like to know more about the developer side of things. Also a lot of people getting beta-access now are very disappointed about your progress the last year and still yell "scam!" which I can sort of understand.

You should be more honest to us early investors about when you think The Grid will be commercially ready and what you plan to do until then. Or is it published somewhere that I just haven´t found yet?

Add item/index parameters and explanation how to post multiple images to one item

hannes [4:31 PM]
bergie: if I do multiple POST /share with the same url, sending images, should they end up in the same post? (edited)

bergie [4:34 PM]
hannes no, unless you use the same item id

hannes [4:36 PM]
bergie: would that be something like an itemId part?

hannes [4:36 PM]
can’t find info here: http://developer.thegrid.io/api.html#content-management-share-post

bergie [4:37 PM]
item and index


hannes [1:08 PM]
bergie: is it possible to share a URL to an item? docs suggest otherwise http://developer.thegrid.io/api.html#content> -management-share-post

hannes [1:08 PM]
only {
"url": "http://example.net/some-article"
}

bergie [1:09 PM]
every share accepts item and index

JSON API

What's the status of the API according to http://jsonapi.org?

Is it compliant and/or are there plans to make it that way if not already?

When can an item be published

Hitting POST /publish can result in 422 Unprocessable entity, e.g. if the item is empty or was already published in that version. All different cases should be documented.

JSON schema definition for rgbcolor is hexadecimal

"rgbcolor": {
  "description": "RGB color",
  "format": "rgbcolor",
  "pattern": "^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$",
  "example": "#aa33cc",
  "type": "string"
},

I would expect this to have red, green, and blue properties.

examples for cover editor

API data examples needed to wire up cover editor:

  • share a tweet, add a comment
  • share a tweet with image, add a comment
  • share a video
  • share an article (image, title, desc), fix spammy title, expand to full post

cc @bergie @jxnblk

"app" property in user response

This is present in the response when making a GET request to https://passport.thegrid.io/api/user, but isn't documented or shown in the schema.

Unless I'm mistaken it's the UUID of the app used to make the request.

It's not present when making a request to https://passport.thegrid.io/api/user/{id}, so can I assume that it's optional?

APN payload not following Notification Specification in some cases

{
    aps =     {
        "content-available" = 1;
    };
    id = "97de34d7-c2c5-42b1-9fa4-341faffdf3c6";
    item = "7518ebf7-1f88-4f2a-a5db-c0c6c275e921";
    type = "finished_block_measurement";
}

{
    aps =     {
        "content-available" = 1;
    };
    id = "7518ebf7-1f88-4f2a-a5db-c0c6c275e921";
    type = "new_item";
}

id and item are not in the specification.

Notifications

There's a mention of notification channels in the current docs but it doesn't go into any detail.

Potential issue with JSON schema output

I see some JSON schema information displayed like this:

screen shot 2015-08-11 at 3 17 37 pm

In particular, I'm not sure if the "$ref": "base.json#/definitions/uuid" part is supposed to be displayed that way or if something has gone wrong with page rendering.

If it is correct, could someone point me to where base.json lives?

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.