Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
api [2017/07/05 17:14]
daniel@atomx.com
api [2018/01/09 09:18]
erik@atomx.com
Line 28: Line 28:
  
 For a list of models and their attributes see: [[api models]]. For a list of models and their attributes see: [[api models]].
 +
 +
 +Invoices
 +--------
 +
 +Invoice lists and the invoice PDFs can be received with the different
 +`/invoices` endpoints.
 +
 +Invoice `type` is one of: `advertiser`,​ `publisher`,​ `network-sell` or `network-buy`.
 +
 +Adding a '​date>'​ request parameter changes the start date (inclusive)
 +of the invoice list and '​date<'​ the end date (exclusive).
 +`date` has the format `YYYY-MM`.
 +
 +E.g. `GET :​api/​invoices/​network-buy/​42?​date>​=2016-10&​date<​=2017-03`
 +will get all invoices from 10.2016 (including) to 03.2017 (excluded).
 +
 +- `/​invoices/​{type}`
 +  Receive all invoices for the specified type.
 +  If no `data` parameter is given it will return a list of invoices for
 +  the current month.
 +- `/​invoices/​{type}/​{id}`
 +  Receive all invoice for the specified type plus id.
 +  If no `date` parameter is given it will default to January this year to the
 +  current month.
 +
 +  E.g. to receive all invoices for advertiser with id 42 of the current year
 +  `GET /​invoices/​advertiser/​42`
 +- `/​invoices/​{type}/​{id}/​{date}`
 +  Download the invoice PDF for the specified date.
  
  
Line 206: Line 236:
 E.g. creating a new `Site`: E.g. creating a new `Site`:
  
-    $ curl -H '​Authorization:​ Bearer eyJhbGciOiXW4UzUxMiIsInR5cCI6IkpXVCJ9.eyJpYXQiWeE0NTkyMjk4MTcsImV4cCI6MTQ1OTgzNDYxNywic3ViIjo0fQ.Dzp7IG3Lp9KcK881mZpp9ge2FKbQ0DlU-eqDsAl8OsE0awlMivL5CDIiETZc9qvRIFxmUXdnasXWLLabl02iig'​ -X POST -d '​{"​name":​ "test site", "​publisher_id":​ "​1"​}'​ -H "​Content-Type:​ application/​json" ​127.0.0.1:6543/v3/site+    $ curl -H '​Authorization:​ Bearer eyJhbGciOiXW4UzUxMiIsInR5cCI6IkpXVCJ9.eyJpYXQiWeE0NTkyMjk4MTcsImV4cCI6MTQ1OTgzNDYxNywic3ViIjo0fQ.Dzp7IG3Lp9KcK881mZpp9ge2FKbQ0DlU-eqDsAl8OsE0awlMivL5CDIiETZc9qvRIFxmUXdnasXWLLabl02iig'​ -X POST -d '​{"​name":​ "test site", "​publisher_id":​ "​1"​}'​ -H "​Content-Type:​ application/​json" ​https://api.atomx.com/v3/site
  
 Would create a new Site and the response would look like: Would create a new Site and the response would look like: