├── LICENSE ├── README.md ├── apiary.apib └── template /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Protocol Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PSA - This specification is out of date, please use [API Docs](https://ipfs.io/docs/api/) for a up to date reference. 2 | 3 | We working towards generating Apiary compliant HTTP API documentation automatically and tests the different implementations to see if they are compliant. Until that happens, we have a docs generation tool that grabs the endpoints from go-ipfs and generates the documentation. 4 | 5 | The tool is [http-api-docs](https://github.com/ipfs/http-api-docs) and generated docs are stored in the [Website Repo](https://github.com/ipfs/website/blob/master/content/docs/api.md) 6 | 7 | --------------------------------------------------------------------------- 8 | --------------------------------------------------------------------------- 9 | 10 | # Apiary IPFS HTTP API description 11 | 12 | [![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) 13 | [![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) 14 | [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) 15 | [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) 16 | 17 | > Apiary IPFS HTTP API description 18 | 19 | [Live API](http://docs.ipfs.apiary.io/#) 20 | 21 | This is the IPFS HTTP API spec, currently based on using the [go-ipfs](https://github.com/ipfs/go-ipfs) implementation. You can find the official API spec at [the specs repo](https://github.com/ipfs/specs/tree/master/public-api). 22 | 23 | ## Usage 24 | 25 | Go look at the [Live API](http://docs.ipfs.apiary.io/#), or check out the [apiary.apib](apiary.apib) source in this repository. If you would like to run the `curl` commands, please have an `ipfs daemon` running. For more on that, go to [go-ipfs](https://github.com/ipfs/go-ipfs). 26 | 27 | ## Contribute 28 | 29 | Feel free to join in. All welcome. Open an [issue](https://github.com/ipfs/http-api-spec/issues)! 30 | 31 | This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md). 32 | 33 | ### Want to hack on IPFS? 34 | 35 | [![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/contributing.md) 36 | 37 | ## License 38 | 39 | MIT 40 | -------------------------------------------------------------------------------- /template: -------------------------------------------------------------------------------- 1 | + Request Without Arguments 2 | 3 | #### curl 4 | 5 | curl -i "http://localhost:5001/api/v0/ls" 6 | 7 | + Body 8 | 9 | ``` 10 | curl -i "http://localhost:5001/api/v0/ls" 11 | ``` 12 | 13 | + Response 14 | 15 | + Headers 16 | 17 | ``` 18 | ``` 19 | 20 | + Attributes 21 | 22 | + Body 23 | 24 | ``` 25 | ``` 26 | 27 | + Request With Empty Argument 28 | 29 | The response is the same if the argument is invalid. For example: 30 | 31 | #### curl 32 | 33 | curl -i "http://localhost:5001/api/v0/ls?arg=" 34 | 35 | + Body 36 | 37 | ``` 38 | curl -i "http://localhost:5001/api/v0/ls?arg=" 39 | ``` 40 | 41 | + Response 500 42 | 43 | + Headers 44 | 45 | ``` 46 | ``` 47 | 48 | + Attributes (Error) 49 | - Message 50 | - Code 51 | 52 | + Body 53 | 54 | ``` 55 | ``` 56 | 57 | + Request With Invalid Argument 58 | 59 | #### curl 60 | 61 | curl -i "http://localhost:5001/api/v0/ls?arg=kitten" 62 | 63 | + Body 64 | 65 | ``` 66 | curl -i "http://localhost:5001/api/v0/ls?arg=kitten" 67 | ``` 68 | 69 | + Response 500 70 | 71 | 72 | + Headers 73 | 74 | ``` 75 | ``` 76 | 77 | + Attributes (Error) 78 | - Message 79 | - Code 80 | 81 | + Body 82 | 83 | ``` 84 | ``` 85 | 86 | + Request With Argument 87 | 88 | #### curl 89 | 90 | curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" 91 | 92 | + Body 93 | 94 | ``` 95 | curl -i "http://localhost:5001/api/v0/ls?arg=QmW2WQi7j6c7UgJTarActp7tDNikE4B2qXtFCfLPdsgaTQ" 96 | ``` 97 | 98 | + Response 99 | 100 | + Headers 101 | 102 | ``` 103 | ``` 104 | 105 | + Attributes 106 | 107 | + Body 108 | 109 | ``` 110 | ``` --------------------------------------------------------------------------------