Add New Location

POST /api/location/add-location

The endpoint for adding a new location for a herb Args: lon (float): the longitude of the location lat (float): the latitude of the location herb (str): the herb to add the location for token (oauth2 bearer token): the token for the user

Returns: (str) A message indicating the success of the operation

Raises: HTTPException: if the user is not logged in

Body Required

  • lon number Required
  • lat number Required
  • herb string Required

Responses

  • 200

    Successful Response

  • 404

    The requested page was not found

  • 422

    Validation Error

    Hide response attribute Show response attribute object
POST /api/location/add-location
curl \
 -X POST http://api.example.com/api/location/add-location \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'lon=42.0&lat=42.0&herb=string'
Request example
{
  "lon": 42.0,
  "lat": 42.0,
  "herb": "string"
}
Request examples
{
  "lon": 42.0,
  "lat": 42.0,
  "herb": "string"
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}