The sites GET request can be used to retrieve the details of all or a single site for the client through the optional use of a path parameter of the siteId.
Responses
-
A Successful response will contain a JSON object with a nested "data" object containing an array of objects with the site details. The records_returned value cna be used for iterative purposes.
Client sites are created through the web portal and each client will always have a minimum of one site.
-
Bad Requests are most likely due to accessToken issues e.g. missing or invalid token.
Important to note that querying a site that does not exist or belong to the client authorised by the accessToken will result in a '200' response with no records returned.
GET
/sites/{siteId}
curl \
-X GET https://api.gift-stream.com/sites/{siteId} \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJpYXQiOjE2NzEwOTc1NDgsImlzcyI6ImFwaS5naWZ0Y2FyZC5hcHBkZWxpdmVyYW5jZS5jb20iLCJuYmYiOjE2NzEwOTc1NDgsImV4cCI6MTY3MTM1Njc0OCwidXNlck5hbWUiOiJjaHJpc0BpaXM5LmNvLnVrIiwiY2xpZW50SWQiOiIyIiwicmVmcmVzaC10b2tlbiI6ImV5SjBlWEFpT2lKS1YxUWlMQ0poYkdjaU9pSklVelV4TWlKOS5leUpwWVhRaU9qRTJOekV3T1RjMU5EZ3NJbWx6Y3lJNkltRndhUzVuYVdaMFkyRnlaQzVoY0hCa1pXeHBkbVZ5WVc1alpTNWpiMjBpTENKdVltWWlPakUyTnpFd09UYzFORGdzSW5WelpYSk9ZVzFsSWpvaVkyaHlhWE5BYVdsek9TNWpieTUxYXlJc0ltTnNhV1Z1ZEVsa0lqb2lNaUlzSW5SdmEyVnVMWFI1Y0dVaU9pSlNSVVpTUlZOSUluMC5ScTJsSTNOc2NlS1JUV1R4WXZYWk50dlNHOXBWQVR2SlJqTnY3Q0o3U0ZsQVZPQkR3aXNRQkw4S0g1dEx3Y204amdLLVJsbnNESmg0a2owdVJKV1ViZyJ9.RrV7u7LKWjVJazCng2GDaYoX_XmAt0V3sOD3tkz_eYRqJwpjUUng891sqRUsDmTXMgkTBEUFOQX8hnDOrwHNfA"
Response examples (200)
{
"message": "OK",
"records_returned": 3,
"timestamp": 1671103099,
"data": [
{
"id": "1",
"addressLine1": "1 Test Street",
"addressLine2": "Test Area",
"addressPcode": "TE1 2STS",
"addressTown": "Test Town",
"siteReference": "FGH7335#",
"sitename": "First Sitess"
},
{
"id": "2",
"addressLine1": "1 Test Street",
"addressLine2": "Test area",
"addressPcode": "TE1 2ST",
"addressTown": "Test Town",
"siteReference": "SDFJSDFJ#",
"sitename": "Second Site"
},
{
"id": "4",
"addressLine1": "testing",
"addressLine2": "The Village",
"addressPcode": "te1 2st",
"addressTown": "testing town",
"siteReference": "REFREFREF",
"sitename": "A Site Name 4"
}
]
}
Response examples (200)
{
"message": "string",
"records_returned": 42,
"timestamp": 42,
"data": [
{
"id": 42,
"addressLine1": "string",
"addressLine2": "string",
"addressPcode": "string",
"addressTown": "string",
"siteReference": "string",
"sitename": "string"
}
]
}
Response examples (400)
{
"message": "Missing Token",
"timestamp": 1671103691
}
Response examples (400)
{
"message": "string",
"timestamp": 42
}