Skip to content

Commit

Permalink
Update README with new spec and instructions
Browse files Browse the repository at this point in the history
update two images
  • Loading branch information
SidneyAllen committed Nov 13, 2018
1 parent 18530e0 commit 3abc35f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,35 @@
An OpenAPI (Swagger) specification for the Xero API

## Description
This repository holds the official Xero [OpenAPI](https://www.openapis.org/) descriptions. We've started with the Accounting API but we'll work on adding more if they prove useful to the community.
This repository holds the official Xero [OpenAPI](https://www.openapis.org/) descriptions.

* [Accounting API - OpenAPI 2.0 - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/spec/accounting2.yaml)
* [Accounting API - OpenAPI 2.0 - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/spec/accounting2.json)
OpenAPI spec 3.0
* [Accounting API - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_accounting_2.0.0_swagger.yaml)
* [Accounting API - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_accounting_2.0.0_swagger.json)
* [Fixed Assets API - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_assets_1.0.0_swagger.yaml)
* [Fixed Assets API - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_assets_1.0.0_swagger.json)


OpenAPI spec 2.0 (Swagger)
* [Accounting API - yaml](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v2/accounting2.yaml)
* [Accounting API - json](https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v2/accounting2.json)

## Preview
There are lots of tools available for viewing OpenAPI descriptions in a nicely formatted way. A popular tool is Swagger UI - a version of which is [hosted here](http://petstore.swagger.io/). In the URL field just enter the 'raw' URL of the spec file e.g.: `https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/master/spec/accounting2.yaml`
There are lots of tools available for viewing and editing OpenAPI descriptions in a nicely formatted way. A popular tool is SwaggerHub - a version of which is [hosted here](https://app.swaggerhub.com/home).

Once you sign up or login, you can create a new API under your account and import a Xero API spec using the 'raw' URL of the spec file e.g.: `https://raw.githubusercontent.com/XeroAPI/Xero-OpenAPI/oas3/spec/v3/Xero_accounting_2.0.0_swagger.yaml`

![SwaggerUI Example](images/swagger-ui.png)
![SwaggerUI Example](images/import-api.png)

## Updates
If you find something missing or incorrect then please [open an issue](https://github.com/XeroAPI/Xero-OpenAPI/issues/new) or send us a pull request. There are lots of tools for editing OpenAPI definitions including the Swagger Editor. Just copy the existing definition into the left-hand window and preview the changes on the right.
If you find something missing or incorrect then please [open an issue](https://github.com/XeroAPI/Xero-OpenAPI/issues/new) or send us a pull request. There are lots of tools for editing OpenAPI definitions including the SwaggerHub. Just use the import instructions above.

![Swagger Editor Example](images/editor.png)
![Swagger Hub Example](images/swaggerhub.png)

## Postman
Postman will automatically import OpenAPI definitions but the OpenAPI spec doesn't support OAuth1.0a. To use our OpenAPI definitions to make requests in Postman you will need to also import the Xero OAuth1a Postman collection from our [Xero-Postman repo](https://github.com/XeroAPI/Xero-Postman).

![Postman Example](images/postman.png)

## Thanks
Thanks very much to @calcinai for contributing the [xero-schemas](https://github.com/calcinai/xero-schemas) from his [xero-php](https://github.com/calcinai/xero-php) project. It was super useful when creating the official definition. Also check out his definitions for [AU Payroll](https://github.com/calcinai/xero-schemas/blob/master/schemas/payroll_au.json), [US Payroll](https://github.com/calcinai/xero-schemas/blob/master/schemas/payroll_us.json), [Assets](https://github.com/calcinai/xero-schemas/blob/master/schemas/assets.json) and [Files](https://github.com/calcinai/xero-schemas/blob/master/schemas/files.json).
Thanks very much to @calcinai for contributing the original swagger 2.0 version of [xero-schemas](https://github.com/calcinai/xero-schemas) from his [xero-php](https://github.com/calcinai/xero-php) project. It was super useful when creating the official definition.
Binary file added images/import-api.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/swaggerhub.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3abc35f

Please sign in to comment.