diff --git a/config/initializers/swagger.rb b/config/initializers/swagger.rb index 57ef594a12..ba8aef184e 100644 --- a/config/initializers/swagger.rb +++ b/config/initializers/swagger.rb @@ -1,4 +1,4 @@ -GrapeSwaggerRails.options.url = '/swagger_doc.json' +GrapeSwaggerRails.options.url = 'api/swagger_doc.json' GrapeSwaggerRails.options.before_filter_proc = proc { GrapeSwaggerRails.options.app_url = request.protocol + request.host_with_port } diff --git a/config/routes.rb b/config/routes.rb index f8424fc5df..77ed000db8 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -10,7 +10,7 @@ #Search RESTful endpoints #constraints(subdomain: 'api') do mount Srch::API => '/api' - mount GrapeSwaggerRails::Engine => '/api/d1ocs' + mount GrapeSwaggerRails::Engine => '/api/docs' #end resources :rusers diff --git a/doc/API.md b/doc/API.md index 2a058dba75..6d879bc000 100644 --- a/doc/API.md +++ b/doc/API.md @@ -1,6 +1,12 @@ (Moved from https://github.com/publiclab/plots2/wiki/API/) -Swagger-generated API documentation can be found at: +## Swagger API + +Our Swagger-generated API is quite extensive and growing: + +### Web interface/guide + +https://publiclab.org/api/docs https://publiclab.org/api/swagger_doc.json @@ -12,6 +18,10 @@ Per-model API endpoints are: * Notes: https://publiclab.org/api/srch/notes?srchString=foo * Locations: https://publiclab.org/api/srch/locations?srchString=lat,lon +**** + +## Legacy API + We also provide RSS feeds for tags and authors, in the format: * Authors: https://publiclab.org/feed/authorname.rss