· View as Markdown

Points of interest

Organizations only. Manage your organization's points of interest and attach them to its routes.

See also: Points of interest.

Returns a list of points of interest

GET /api/v1/points_of_interest.json

Returns a paginated list of points of interest for the authenticated organization.

Note: This endpoint is available for organizations only.

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Parameters

  • page integer query
    Page number for pagination
  • page_size integer query
    Number of items per page (20-200)

Response 200

  • points_of_interest array of objects
    10 fields
    • id integer
    • user_id integer
    • type string
    • type_id integer
    • type_name string
    • name string
    • description string or null
    • url string
    • lat number
    • lng number
  • meta object
    1 field
    • pagination object
      4 fields
      • record_count integer
        Total number of records
      • page_count integer
        Total number of pages
      • page_size integer
        Number of records per page
      • next_page_url string or null
        URL for the next page (null if last page)

Errors

  • 401 Unauthorized
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  https://ridewithgps.com/api/v1/points_of_interest.json
Response 200
{
  "points_of_interest": [
    {
      "id": 123,
      "user_id": 123,
      "type": "coffee",
      "type_id": 123,
      "type_name": "Coffee",
      "name": "Coffee stop",
      "description": "Good espresso before the climb",
      "url": "https://ridewithgps.com/api/v1/points_of_interest/123.json",
      "lat": 45.521529,
      "lng": -122.691804
    }
  ],
  "meta": {
    "pagination": {
      "record_count": 45,
      "page_count": 3,
      "page_size": 20,
      "next_page_url": "https://ridewithgps.com/api/v1/points_of_interest.json?page=2"
    }
  }
}

Returns the specified point of interest

GET /api/v1/points_of_interest/{id}.json

Returns detailed information about a specific point of interest.

Note: This endpoint is available for organizations only.

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Parameters

  • id integer path required

Response 200

  • point_of_interest object
    12 fields
    • id integer
    • user_id integer
    • type string
    • type_id integer
    • type_name string
    • name string
    • description string or null
    • url string
    • lat number
    • lng number
    • distances array of numbers
      Distances from start in meters for waypoints
    • tag_names array of strings

Errors

  • 401 Unauthorized
  • 404 Point of interest not found
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  https://ridewithgps.com/api/v1/points_of_interest/123.json
Response 200
{
  "point_of_interest": {
    "id": 123,
    "user_id": 123,
    "type": "coffee",
    "type_id": 123,
    "type_name": "Coffee",
    "name": "Coffee stop",
    "description": "Good espresso before the climb",
    "url": "https://ridewithgps.com/api/v1/points_of_interest/123.json",
    "lat": 45.521529,
    "lng": -122.691804,
    "distances": [
      12487.3
    ],
    "tag_names": [
      "Tag names"
    ]
  }
}

Creates a point of interest

POST /api/v1/points_of_interest.json

Create a new point of interest in the authenticated organization's library.

Note: This endpoint is available for organizations only.

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Request body application/json

  • point_of_interest object required
    7 fields
    • name string
    • description string or null
    • poi_type string
    • url string or null
    • lat number
      Latitude
    • lng number
      Longitude
    • tag_names array of strings
      Replaces all tags. Send an empty array to remove them.

Response 200

  • point_of_interest object
    10 fields
    • id integer
    • user_id integer
    • type string
    • type_id integer
    • type_name string
    • name string
    • description string or null
    • url string
    • lat number
    • lng number

Errors

  • 401 Unauthorized
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
  "point_of_interest": {
    "name": "Coffee stop",
    "description": "Good espresso before the climb",
    "poi_type": "coffee",
    "url": "https://example.com",
    "lat": 45.521529,
    "lng": -122.691804,
    "tag_names": [
      "Tag names"
    ]
  }
}' \
  https://ridewithgps.com/api/v1/points_of_interest.json
Response 200
{
  "point_of_interest": {
    "id": 123,
    "user_id": 123,
    "type": "coffee",
    "type_id": 123,
    "type_name": "Coffee",
    "name": "Coffee stop",
    "description": "Good espresso before the climb",
    "url": "https://ridewithgps.com/api/v1/points_of_interest/123.json",
    "lat": 45.521529,
    "lng": -122.691804
  }
}

Associates a point of interest with a route

POST /api/v1/points_of_interest/{id}/routes/{route_id}.json

Associates a point of interest with a specific route

Note: This endpoint is available for organizations only.

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Parameters

  • id integer path required
  • route_id integer path required

Errors

  • 404 POI or route not found
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  -X POST \
  https://ridewithgps.com/api/v1/points_of_interest/123/routes/123.json

Updates the specified point of interest

PUT /api/v1/points_of_interest/{id}.json

Updates an existing point of interest in the authenticated organization's library.

Note: This endpoint is available for organizations only.

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Parameters

  • id integer path required

Request body application/json

  • point_of_interest object required
    7 fields
    • name string
    • description string or null
    • poi_type string
    • url string or null
    • lat number
      Latitude
    • lng number
      Longitude
    • tag_names array of strings
      Replaces all tags. Send an empty array to remove them.

Response 200

  • point_of_interest object
    12 fields
    • id integer
    • user_id integer
    • type string
    • type_id integer
    • type_name string
    • name string
    • description string or null
    • url string
    • lat number
    • lng number
    • distances array of numbers
      Distances from start in meters for waypoints
    • tag_names array of strings

Errors

  • 401 Unauthorized
  • 404 Point of interest not found
  • 422 Validation error
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  -X PUT \
  -H "Content-Type: application/json" \
  -d '{
  "point_of_interest": {
    "name": "Coffee stop",
    "description": "Good espresso before the climb",
    "poi_type": "coffee",
    "url": "https://example.com",
    "lat": 45.521529,
    "lng": -122.691804,
    "tag_names": [
      "Tag names"
    ]
  }
}' \
  https://ridewithgps.com/api/v1/points_of_interest/123.json
Response 200
{
  "point_of_interest": {
    "id": 123,
    "user_id": 123,
    "type": "coffee",
    "type_id": 123,
    "type_name": "Coffee",
    "name": "Coffee stop",
    "description": "Good espresso before the climb",
    "url": "https://ridewithgps.com/api/v1/points_of_interest/123.json",
    "lat": 45.521529,
    "lng": -122.691804,
    "distances": [
      12487.3
    ],
    "tag_names": [
      "Tag names"
    ]
  }
}

Deletes the specified point of interest

DELETE /api/v1/points_of_interest/{id}.json

Deletes a point of interest owned by the authenticated organization.

Note: This endpoint is available for organizations only.

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Parameters

  • id integer path required

Response 204

Point of interest deleted successfully

Errors

  • 401 Unauthorized
  • 404 Point of interest not found
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  -X DELETE \
  https://ridewithgps.com/api/v1/points_of_interest/123.json
Response 204
// Point of interest deleted successfully

Disassociates a point of interest from a route

DELETE /api/v1/points_of_interest/{id}/routes/{route_id}.json

Removes the association between a point of interest and a specific route

Note: This endpoint is available for organizations only.

Headers

  • x-rwgps-api-key string required
    API key for identifying the client application
  • x-rwgps-auth-token string required
    Authentication token for the user

Parameters

  • id integer path required
  • route_id integer path required

Response 204

POI disassociated from route successfully

Errors

  • 401 Unauthorized
  • 404 POI or route not found
Request
curl \
  -H "x-rwgps-api-key: $API_KEY" \
  -H "x-rwgps-auth-token: $AUTH_TOKEN" \
  -X DELETE \
  https://ridewithgps.com/api/v1/points_of_interest/123/routes/123.json
Response 204
// POI disassociated from route successfully