diff --git a/postman/collections/Fleetbase Storefront API/Store/List Locations.request.yaml b/postman/collections/Fleetbase Storefront API/Store/List Locations.request.yaml index 1c36794..0455992 100644 --- a/postman/collections/Fleetbase Storefront API/Store/List Locations.request.yaml +++ b/postman/collections/Fleetbase Storefront API/Store/List Locations.request.yaml @@ -2,4 +2,14 @@ $kind: http-request description: List Locations url: "{{base_url}}/{{api_prefix}}/{{namespace}}/locations" method: GET +scripts: + - type: afterResponse + code: |- + // Retrieve Location addresses {{location_id}}; nothing set it. + var json_response = pm.response.json(); + + if (Array.isArray(json_response) && json_response.length) { + pm.environment.set("location_id", json_response[0].id); + } + language: text/javascript order: 2400