Skip to content

Endpoints

Joaquín Romero Moreno edited this page Mar 24, 2019 · 29 revisions

Login POST /api/v1/login

What you send:

{
  "username": "sample",
  "password": "sample-password"
}

What you'll receive:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

Create offer POST /api/v1/offer/

{
  "title": TEXT("test title"),
  "description": TEXT("test description"),
  "price_offered": FLOAT(1500.99),
  "currency": CHOICE('0'->EUROS, '1'->DOLLARS, '2'->POUNDS),
  "limit_time": DATETIME(7 attributes are being sent, https://docs.python.org/3/library/datetime.html, Attributes: year, month, day, hour, minute, second, microsecond), (2019,10,30,10,40,0,0)
}

Hello World GET /api/v1/helloworld

Headers:

{
  "Authentication": "JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
}

What you'll receive:

{
  "saludo": "Hola, <<Username>>"
}

Create contract POST /api/v1/contract/

{
  "title": TEXT("test title"),
  "description": TEXT("test description"),
  "price_offered": FLOAT(1500.99),
  "currency": CHOICE('0'->EUROS, '1'->DOLLARS, '2'->POUNDS),
  "limit_time": DATETIME(7 attributes are being sent, https://docs.python.org/3/library/datetime.html, Attributes: year, month, day, hour, minute, second, microsecond), (2019,10,30,10,40,0,0)
}

Create contract POST /api/v1/contract/

Siendo dataScientist y offer las IDs

{
limit_date:2018,12,03,23,02,02,12
accepted_ds:True
accepted_company:True
expiration:30
dataScientist:1
offer:1
}

What you'll receive:

 {"message": "Successfully created new contract"}

list apply GET /api/v1/apply/

Para los filtros PE, AC,RE

{
userId:2
filtro:PE
}

What you'll receive:

"[{\"model\": \"datame.apply\", \"pk\": 1, \"fields\": {\"title\": \"Apply1\", \"description\": \"apply1\", \"date\": \"2019-03-24T16:10:43Z\", \"status\": \"PE\", \"dataScientist\": 1, \"offer\": 1}}, {\"model\": \"datame.apply\", \"pk\": 4, \"fields\": {\"title\": \"Apply3\", \"description\": \"Apply3\", \"date\": \"2019-03-24T16:34:06Z\", \"status\": \"PE\", \"dataScientist\": 1, \"offer\": 1}}]"

list offer GET /api/v1/offer/

No necesita parámetros, tan solo petición GET a la url

What you'll receive:

"[{\"model\": \"datame.offer\", \"pk\": 1, \"fields\": {\"title\": \"offer1\", \"description\": \"offer1\", \"price_offered\": 300.0, \"currency\": \"0\", \"creation_date\": \"2019-03-24T17:42:05.983Z\", \"limit_time\": \"2019-03-27T17:42:02Z\"}}]"

Clone this wiki locally