Phygrid Developers
Browse Topics
Spaces API Reference / Phygrid Developers

Spaces API Reference

Postman Collection

For easy configuration and testing, here's a Postman collection you can import into Postman.

Download the Postman Collection

Configuration Notes:

Before making API requests, update the following placeholders and headers to match your setup:

  1. URL Placeholders: Replace <tenant-id>, <environment>, and <space-id> with your specific tenant, environment, and space values.
  2. Data Residency: Replace <data-residency> with one of these options: eu, us, in, au, or uae.
  3. Headers: For Products API: Set x-api-key to your access token. For Spaces API: Use the Authorization header with the value Bearer <access token>.

Authentication

To use the Grid Products API, every request requires an access token. Here's how to generate one:

  1. Go to the Apps → Developer tab in the Phygrid Console.
  2. Generate an Access Token.
  3. Add Authorization in the API request header, with the Bearer <access token> as value for the Spaces related endpoints below

URLs Overview

The following endpoints are available in the Spaces API currently.

Grid Admin API: https://api.omborigrid.com/api

In every endpoint you will need to replace {base-url} with the URL specified above.

MethodEndpointDescription
GETspacesReturns a list of tenant’s spaces
GETspaces/{id}Retrieves specific space by ID
POSTspacesCreates a space record into the database
DELETEspacesRemoves specified space ID from the database
PUTspaces/{id}Update specified space in the database
DELETEspaces/{spaceId}/productsRemoves products from space

Spaces

GET Spaces List

Returns a list of tenant's spaces.

GET {base-url}/spaces

Query Parameters

To use query parameters, add them as GET properties to the URL.

ParameterTypeDescriptionExample
organizationIdstringThe tenant id in grid console61cxxxxxxxxxxxxxxx

Response

Array<Space>

GET Space by ID

Retrieves specific space by ID.

GET {base-url}/spaces/{id}

Query Parameters

To use query parameters, add them as GET properties to the URL.

ParameterTypeDescriptionExample
idstringThe ID of the space61cxxxxxxxxxxxxxxx

Response

Space

Reference: Space

POST (Create) Space

Creates a space record

POST {base-url}/spaces

Body

The body of the request should be a Space JSON format using the content-type header application/json.

ParameterTypeDescriptionExample
organizationIdstringThe organization/tenant where the space will be created61cxxxxxxxxxxxxxxx
displayNamestringThe name of the space to be displayedStore #1
typestringThe type of the space (location, section, custom)location
longitudenumberLongitude of the space59.32960273523599
latitudenumberLatitude of the space18.06886331765492
externalIdstringId of the space managed externallystore_1
countrystringThe name of the countrySweden
statestringThe name of the stateSweden
citystringThe name of the cityStockholm
addressstringThe addressStreet#1
postcodestringRepresents the postal code111 37
weeklyScheduleobjectThe normal opening hours{"0": {"from": "08:00", "to": "17:30", "isOpen": true}, ...} “0” represents Monday
notesstringAdd notes to the spaceNote#1 sample

Response

Space

Reference: Space

PUT (Update) Space

Updates a space record

PUT {base-url}/spaces/{id}

Query Parameters

ParameterTypeDescriptionExample
idstringThe ID of the space61cxxxxxxxxxxxxxxx

Body

The body of the request should be a Space JSON format using the content-type header application/json.

ParameterTypeDescriptionExample
organizationIdstringThe organization/tenant where the space will be created61cxxxxxxxxxxxxxxx
displayNamestringThe name of the space to be displayedStore #1
typestringThe type of the space (‘location’, ‘section’)location
longitudenumberLongitude of the space59.32960273523599
latitudenumberLatitude of the space18.06886331765492
externalIdstringID of the space managed externallystore_1
countrystringThe name of the countrySweden
statestringThe name of the stateSweden
citystringThe name of the cityStockholm
addressstringThe addressStreet#1
postcodestringRepresents the postal code111 37
weeklyScheduleobjectThe normal opening hours{"0": {"from": "08:00", "to": "17:30", "isOpen": true}, ...}
notesstringAdd notes to the spaceNote#1 sample

Response

Space

Reference: Space

DELETE Space

Deletes a Space record.

DELETE {base-url}/spaces/{id}

Query Parameters

ParameterTypeDescriptionExample
idstringThe ID of the space61cxxxxxxxxxxxxxxx

Response

Space

Reference: Space

© 2024 · Phygrid. An Ombori company