POST/v2/sharesCreate a share

Create a share
headerAuthorizationAuthentication token (bearer token or API key).
{
"organizationId" : Number,
"startDate" : Local date (ISO 8601, e.g. "2022-06-23"),
"startTime" : Local time (ISO 8601, e.g. "13:53:02"),
"endDate" : Local date (ISO 8601, e.g. "2022-06-23"),
"endTime" : Local time (ISO 8601, e.g. "13:53:02"),
"schedule" : [{
"dayOfWeek" : "Monday" / "Tuesday" / "Wednesday" / "Thursday" / "Friday" / "Saturday" / "Sunday",
"period" : {
"startTime" : Local time (ISO 8601, e.g. "13:53:02"),
"endTime" : Local time (ISO 8601, e.g. "13:53:02")
},
"recurrence" : "Daily" / "Weekly" / "BiWeekly"
}]
,
"permissions" : {
"administrate" : Boolean,
"remoteActivate" : Boolean,
"assignKeyfob" : Boolean
},
"source" : {
"deviceId" : Number,
"deviceGroupId" : Number
},
"receiver" : {
"userId" : Number,
"userGroupId" : Number
},
"personalSettings" : {
"notifications" : Boolean
}
}

Response

status200All ok
status401Invalid authentication token
status403Insufficient rights
status404share not found
{
"shareId" : Number,
"token" : String, UUID 4 formatted (e.g. "a426e157-8a5c-456a-8865-bec6394867ab")
}

Example: Create a share

POST/v2/shares

headerAuthorizationBearer 293891d1-9278-4468-b322-6887e5e39164
{
"organizationId": 1,
"schedule": [{
"dayOfWeek": "Monday",
"recurrence": "Weekly"
}
]
,
"permissions": {
"administrate": false,
"remoteActivate": true,
"assignKeyfob": true
}
,
"source": {
"deviceId": 1
}
,
"receiver": {
"userId": 2
}
,
"personalSettings": {
"notifications": true
}
}

Response

status200
headerAccess-Control-Expose-Headersauthorization, content-type
headerAccess-Control-Allow-Headersauthorization, content-type
headerAccess-Control-Allow-MethodsGET, POST, DELETE, OPTIONS, PUT
headerAccess-Control-Allow-Origin*
headerStrict-Transport-Securitymax-age=31536000; includeSubDomains
headerX-Frame-OptionsSAMEORIGIN
headerX-Content-Type-Optionsnosniff
headerX-XSS-Protection1; mode=block
headerContent-Security-Policydefault-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
headerReferrer-Policyno-referrer
headerFeature-Policyself
headerPermissions-policyinterest-cohort=()
{
"shareId": 3
}

Example: Create a share with invalid User Id

POST/v2/shares

headerAuthorizationBearer 2f41dafc-e24e-47af-a80b-f644fba8b137
{
"organizationId": 1,
"schedule": [{
"dayOfWeek": "Monday",
"recurrence": "Weekly"
}
]
,
"permissions": {
"administrate": true,
"remoteActivate": true,
"assignKeyfob": true
}
,
"source": {
"deviceId": 1
}
,
"receiver": {
"userId": -1
}
,
"personalSettings": {
"notifications": true
}
}

Response

status400
headerAccess-Control-Expose-Headersauthorization, content-type
headerAccess-Control-Allow-Headersauthorization, content-type
headerAccess-Control-Allow-MethodsGET, POST, DELETE, OPTIONS, PUT
headerAccess-Control-Allow-Origin*
headerStrict-Transport-Securitymax-age=31536000; includeSubDomains
headerX-Frame-OptionsSAMEORIGIN
headerX-Content-Type-Optionsnosniff
headerX-XSS-Protection1; mode=block
headerContent-Security-Policydefault-src 'none'; frame-ancestors 'none'; base-uri 'none'; form-action 'none'
headerReferrer-Policyno-referrer
headerFeature-Policyself
headerPermissions-policyinterest-cohort=()
{
"message": "Invalid input",
"code": "invalidInputErrorError",
"errorMessage": "Invalid input",
"errorCode": "invalidInputErrorError"
}