Api::V1::EncountersController API

Encounters

Create encounter with no message

POST /api/v1/tours/:tour_id/encounters

Parameters

Name Description
token User token
tour_id Tour id
encounter[street_person_name] Encounter street person name
encounter[date] Encounter date
encounter[latitude] Encounter latitude
encounter[longitude] Encounter longitude
encounter[message] Encounter message
encounter[voice_message] Voice message URL

Request

Headers

Content-Type: application/json
Host: example.org
Cookie: 

Route

POST /api/v1/tours/2/encounters

Body

{"token":"foobar6","tour_id":2,"encounter":{"street_person_name":"John Doe","date":"2021-01-01 00:00:00","latitude":48.870424,"longitude":2.30682}}

Response

Headers

X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Referrer-Policy: strict-origin-when-cross-origin
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,PUT,PATCH,DELETE
Access-Control-Allow-Headers: Origin,Accept,Content-Type,X-Requested-With,X-CSRF-Token,X-API-KEY
Content-Type: application/json; charset=utf-8
ETag: W/"17b62d88e6fba0398edcb4d1343fe251"
Cache-Control: max-age=0, private, must-revalidate
X-Request-Id: 596bd563-84f9-4ad4-979e-e4bdcba6a0ce
X-Runtime: 0.013184
Content-Length: 201

Status

201 Created

Body

{
  "encounter": {
    "id": 2,
    "date": "2021-01-01T00:00:00.000+01:00",
    "latitude": 48.870424,
    "longitude": 2.30682,
    "user_id": 6,
    "user_name": "John",
    "street_person_name": "John Doe",
    "message": null,
    "voice_message": null
  }
}