Depois de criar uma rota, use o endpoint GET da API Roads Selection para receber informações sobre ela e monitorar o status de validação.
Esta página descreve como listar todas as rotas selecionadas no seu projeto e como receber detalhes de uma rota selecionada específica.
Receber uma rota selecionada específica
Para receber informações sobre uma rota selecionada específica, envie uma GET solicitação ao
get endpoint, incluindo o selectedRouteId da rota que você quer
recuperar.
"https://roads.googleapis.com/selection/v1/projects/PROJECT_NUMBER/selectedRoutes/SELECTED_ROUTE_ID"
O exemplo de código a seguir mostra a estrutura de uma solicitação GET ao endpoint
get para receber informações sobre uma única rota selecionada.
curl -X GET \ -H 'X-Goog-User-Project: PROJECT_NUMBER' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ "https://roads.googleapis.com/selection/v1/projects/PROJECT_NUMBER/selectedRoutes/SELECTED_ROUTE_ID"
O exemplo de código a seguir mostra a estrutura de uma
get resposta do endpoint com as informações de uma única rota selecionada.
{
"name": "projects/PROJECT_NUMBER/selectedRoutes/SELECTED_ROUTE_ID",
"dynamicRoute": {
"origin": {
"latitude": ORIGIN_LATITUDE,
"longitude": ORIGIN_LONGITUDE
},
"destination": {
"latitude": DESTINATION_LATITUDE,
"longitude": DESTINATION_LONGITUDE
},
"intermediates": [
{
"latitude": LATITUDE,
"longitude": LONGITUDE
},
{
"latitude": LATITUDE,
"longitude": LONGITUDE
},
{
"latitude": LATITUDE,
"longitude": LONGITUDE
}
]
},
"createTime": "CREATE_TIME",
"state": "STATE"
}
Listar rotas selecionadas
Para listar todas as rotas selecionadas associadas ao seu projeto, envie uma GET
solicitação ao endpoint list.
https://roads.googleapis.com/selection/v1/projects/PROJECT_NUMBER/selectedRoutes
O exemplo de código a seguir mostra a estrutura de uma solicitação GET ao endpoint list para receber as informações de todas as rotas selecionadas associadas a um projeto do Google Cloud.
curl -X GET \ -H 'X-Goog-User-Project: PROJECT_NUMBER' \ -H 'Authorization: Bearer ACCESS_TOKEN' \ "https://roads.googleapis.com/selection/v1/projects/PROJECT_NUMBER/selectedRoutes"
O exemplo de código a seguir mostra a estrutura de uma resposta do endpoint list
com as informações de todas as rotas selecionadas associadas a um projeto do Google Cloud.
{
"selectedRoutes": [
{
"name": "projects/PROJECT_NUMBER/selectedRoutes/SELECTED_ROUTE_ID",
"dynamicRoute": {
"origin": {
"latitude": ORIGIN_LATITUDE,
"longitude": ORIGIN_LONGITUDE
},
"destination": {
"latitude": DESTINATION_LATITUDE,
"longitude": DESTINATION_LONGITUDE
}
},
"createTime": "CREATE_TIME",
"state": "STATE"
},
{
"name": "projects/PROJECT_NUMBER/selectedRoutes/SELECTED_ROUTE_ID",
"dynamicRoute": {
"origin": {
"latitude": ORIGIN_LATITUDE,
"longitude": ORIGIN_LONGITUDE
},
"destination": {
"latitude": DESTINATION_LATITUDE,
"longitude": DESTINATION_LONGITUDE
},
"intermediates": [
{
"latitude": LATITUDE,
"longitude": LONGITUDE
},
{
"latitude": LATITUDE,
"longitude": LONGITUDE
},
{
"latitude": LATITUDE,
"longitude": LONGITUDE
}
]
},
"createTime": "CREATE_TIME",
"state": "STATE"
},
]
}