# StreamLayer Integration Service - Invitation Links API
## Create Invitation Link
### Request
```
POST /api/invitation-links
{
"id": "hsGa7sgD",
"sourceId": 1,
"metadata": {
"key": "value",
}
}
```
### Response
```
200 OK
{
"id": "hsGa7sgD",
"url": "https://www.stoiximan.gr/watchparty/hsGa7sgD",
"sourceId": 1,
"metadata": {
"key": "value",
},
"createdUtc": "2023-10-28 00:00:00"
}
```
## Get Invitation Link by URL
### Request
```
GET /api/invitation-links?url=https%3A%2F%2Fwww.stoiximan.gr%2Fwatchparty%2FhsGa7sgD
```
### Response (Found)
```
200 OK
{
"id": "hsGa7sgD",
"url": "https://www.stoiximan.gr/watchparty/hsGa7sgD",
"sourceId": 1,
"metadata": {
"key": "value",
},
"createdUtc": "2023-10-28 00:00:00"
}
```
### Response (Expired or Not Found)
```
404 Not Found
```
## Get Invitation Link by ID
### Request
```
GET /api/invitation-links/hsGa7sgD
```
### Response (Found)
```
200 OK
{
"id": "hsGa7sgD",
"url": "https://www.stoiximan.gr/watchparty/hsGa7sgD",
"sourceId": 1,
"metadata": {
"key": "value",
},
"createdUtc": "2023-10-28 00:00:00"
}
```
### Response (Expired or Not Found)
```
404 Not Found
```
## Notes
- `id` is the invitation link's alphanumeric ID,
- `url` is the final absolute URL including the scheme, domain & path,
- `sourceId` is the source which the URL was created for,
- `metadata` is a key-value pair to store additional information for this link. The key is always a string and the value can be any type, which means that the caller should be able to "parse" properly the values.
- `createdUtc` is the date and time in UTC that the link was created.
# Native API Application - Invitation Links API
## Create Invitation Link
### Request
```
POST /api/watchparty/invitation-link
{
"groupId": "hsGa7sgD",
"streamlayerJson": "{...}"
}
```
### Response
```
200 OK
{
"url": "https://www.stoiximan.gr/watchparty/hsGa7sgD",
}
```
## Get Invitation Link by ID
### Request
```
GET /api/watchparty/invitation-link?id=hsGa7sgD
```
### Response (Found)
```
200 OK
{
"groupId": "hsGa7sgD",
"streamlayerJson": "{...}"
}
```
### Response (Expired or Not Found)
```
404 Not Found
```