Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

API Docs

Victor Nițu edited this page Mar 19, 2016 · 1 revision

#API Docs

Endpoints

Resources

resources :users, only: [:show]
resources :networks, only: [:create, :index, :show, :update]

RESTful routing model here, nothing special.

Contracts

namespace :contracts do
post '/', to: 'contracts#index'

Parameters (all are optional):

  • countries: []
    • validation rule: country code ([A-Z]{2,2})
    • if code is not found in Redis store => not valid
  • cpvs: []
    • validation rule: CPV code format
    • if code is not found in Elasticsearch store => not valid
  • years: []
    • must contain number
post 'count', to: 'contracts#count'

/api/v1/contracts/count – same query string as /contracts, but returns only the count

# Suppliers details in the context of a network
get 'suppliers_details', to: 'suppliers#details'
# Procuring Entities in the context of a network
post 'procuring_entities_details', to: 'procuring_entities#details'

Extra parameter supplier_ids

# All countries in the contracts
get 'countries', to: 'countries#index'
# Query cpvs for autocompletion
get 'cpvs/autocomplete', to: 'cpvs#autocomplete'
get '/:id', to: 'contracts#show'
Clone this wiki locally