seniorvu-sdk
Version:
JS wrapper SDK for the SeniorVu web API
1,868 lines (1,867 loc) • 81 kB
JSON
{
"swagger": "2.0",
"info": {
"title": "Seniorvu Internal API",
"version": "1.0.0"
},
"basePath": "/",
"produces": [
"application/json"
],
"securityDefinitions": {
"jsonWebToken": {
"type": "apiKey",
"name": "access_token",
"in": "query"
}
},
"paths": {
"/auth/login": {
"post": {
"summary": "User Authorization",
"description": "User authorization endpoint",
"parameters": [
{
"name": "body",
"description": "User credentials",
"in": "body",
"schema": {
"$ref": "#/definitions/Credentials",
"type": "object",
"required": [
"email",
"password"
]
}
}
],
"tags": [
"Auth"
],
"responses": {
"200": {
"description": "Token to use for authorization needs"
},
"401": {
"description": "User not found or incorrect password"
}
}
}
},
"/auth/registration": {
"post": {
"summary": "Register new user",
"description": "Register new user and return authorization token",
"parameters": [
{
"name": "credentials",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/Credentials"
}
}
],
"tags": [
"Auth"
],
"responses": {
"200": {
"description": "Token to use for authorization needs"
},
"400": {
"description": "User already exists"
},
"404": {
"description": "Missing credentials"
}
}
}
},
"/api/claimRequests": {
"get": {
"summary": "List claim requests",
"parameters": [
{
"name": "status",
"in": "query",
"description": "Filter by claim request status: 'approved', 'declined', 'pending'. The service defaults to 'pending'.",
"type": "string"
},
{
"name": "s",
"in": "query",
"description": "Search string to filter claim requests",
"type": "string"
}
],
"tags": [
"Claim Requests"
],
"responses": {
"200": {
"description": "List claim requests"
},
"401": {
"description": "User is not authorized to perform operation"
},
"403": {
"description": "User is forbidden to perform operation"
},
"404": {
"description": "The claim request was not found"
}
}
}
},
"/api/communities": {
"get": {
"summary": "List communities",
"description": "Information returned depends on user authorization",
"parameters": [
{
"name": "q",
"in": "query",
"description": "Search string to filter communities by name",
"required": false,
"type": "string"
},
{
"$ref": "#/definitions/offset"
},
{
"$ref": "#/definitions/limit"
}
],
"tags": [
"Communities"
],
"responses": {
"200": {
"description": "A list of communities",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/CommunityFull"
}
}
}
}
},
"post": {
"summary": "Create community",
"description": "Create new community",
"parameters": [
{
"name": "community",
"in": "body",
"schema": {
"$ref": "#/definitions/CommunityFull"
}
}
],
"tags": [
"Communities"
],
"responses": {
"201": {
"description": "Created community",
"schema": {
"$ref": "#/definitions/CommunityFull"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is not authorized"
}
}
}
},
"/api/communities/{communityId}": {
"get": {
"summary": "Get community",
"description": "Information returned depends on authorization",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "The community identifier",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Get info about single community",
"schema": {
"$ref": "#/definitions/Community"
}
},
"404": {
"description": "Community with given id is not found"
}
}
},
"put": {
"summary": "Update community",
"description": "Some fields can only be updated by authorized users",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "The community identifier",
"required": true,
"type": "integer"
},
{
"name": "community",
"in": "body",
"schema": {
"$ref": "#/definitions/CommunityFull"
}
}
],
"responses": {
"200": {
"description": "Updated community JSON",
"schema": {
"$ref": "#/definitions/CommunityFull"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is not authorized"
},
"404": {
"description": "Community with given id was not found"
}
}
},
"delete": {
"summary": "Delete existing community",
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"description": "Authorized user can delete existing community",
"tags": [
"Communities"
],
"responses": {
"204": {
"description": "Existing community has been successfully deleted"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community with given id is not found"
}
}
}
},
"/api/communities/{communityId}/address": {
"put": {
"summary": "Update community address",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"required": true,
"type": "integer"
},
{
"name": "Coordinates",
"in": "body",
"description": "New latitude and longitude for the community",
"required": true,
"schema": {
"$ref": "#/definitions/Coordinates"
}
}
],
"responses": {
"200": {
"description": "Address successfully updated"
},
"400": {
"description": "Bad latitude or longitude values"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is not authorized"
},
"404": {
"description": "Community is not found"
}
}
}
},
"/api/communities/{communityId}/amenities": {
"get": {
"summary": "List community amenities",
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "Community identifier",
"type": "integer",
"required": true
}
],
"tags": [
"Communities"
],
"responses": {
"200": {
"description": "List of community amenities",
"schema": {
"title": "Amenities",
"type": "array",
"items": {
"$ref": "#/definitions/CommunityAmenity"
}
}
},
"404": {
"description": "Community is not found"
}
}
},
"put": {
"summary": "Set active/inactive amenities for community",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"required": true,
"type": "integer"
},
{
"name": "amenities",
"in": "body",
"description": "Array of amenities IDs to be set as active for current community",
"schema": {
"type": "array",
"items": {
"type": "integer"
}
}
}
],
"responses": {
"200": {
"description": "Array of amenities, which status was updated"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community is not found"
}
}
}
},
"/api/communities/{communityId}/appointments": {
"post": {
"summary": "Create new appointment request for community",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"type": "integer",
"required": true
},
{
"name": "appointment",
"in": "body",
"schema": {
"$ref": "#/definitions/AppointmentRequest"
}
}
],
"responses": {
"201": {
"description": "New appointment request successfully created"
}
}
}
},
"/api/communities/{communityId}/archivedLeads": {
"get": {
"summary": "Get list of community's archived leads",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
}
],
"responses": {
"200": {
"description": "List of all archived leads",
"schema": {
"title": "Archived leads",
"type": "array",
"items": {
"$ref": "#/definitions/Lead"
}
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community was not found"
}
}
},
"post": {
"summary": "Add lead to archived",
"tags": [
"Leads",
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
},
{
"name": "leadId",
"in": "body",
"description": "ID of lead to be added to archived",
"required": true,
"schema": {
"type": "integer"
}
}
],
"responses": {
"200": {
"description": "Lead was successfully added to archived",
"schema": {
"$ref": "#/definitions/Lead"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community or lead was not found"
}
}
}
},
"/api/communities/{communityId}/archivedLeads/{archivedLeadId}": {
"delete": {
"summary": "Unarchive lead",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
},
{
"name": "archivedLeadId",
"in": "path",
"description": "ID of the archived lead",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Lead was successfully unarchived"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community or archived lead was not found"
}
}
}
},
"/api/communities/{communityId}/assets": {
"get": {
"summary": "Get all assets of a given community",
"description": "Retrieve array of community assets (images and videos) as JSON objects",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Array of community assets objects",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/CommunityAsset"
}
}
},
"404": {
"description": "Community was not found"
}
}
}
},
"/api/communities/{communityId}/assets/image": {
"post": {
"summary": "Upload new image for community",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "asset",
"in": "formData",
"description": "Image file to upload",
"required": true,
"type": "file"
}
],
"consumes": [
"multipart/form-data"
],
"responses": {
"201": {
"description": "New image successfully uploaded",
"schema": {
"$ref": "#/definitions/CommunityAsset"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Video asset was not found / invalid video URL"
}
}
}
},
"/api/communities/{communityId}/assets/video": {
"post": {
"summary": "Add youtube / vimeo video to community",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "Video",
"in": "body",
"description": "Video url and type (360, flyover, etc.)",
"required": true,
"schema": {
"$ref": "#/definitions/Video"
}
}
],
"responses": {
"201": {
"description": "New video successfully added for community",
"schema": {
"$ref": "#/definitions/CommunityAsset"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Video asset was not found / invalid video URL"
}
}
}
},
"/api/communities/{communityId}/assets/awsSettings": {
"get": {
"summary": "Get settings for uploading to amazon bucket",
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"tags": [
"Communities"
],
"responses": {
"200": {
"description": "AWS settings to upload files for specified bucket"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
}
}
}
},
"/api/communities/{communityId}/assets/{assetId}": {
"put": {
"summary": "Update existing asset",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "assetId",
"in": "path",
"description": "ID of the asset",
"required": true,
"type": "integer"
},
{
"name": "asset",
"in": "body",
"schema": {
"$ref": "#/definitions/CommunityAsset"
}
}
],
"responses": {
"200": {
"description": "Asset successfully updated"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community or community asset was not found"
}
}
}
},
"/api/communities/{communityId}/cartItems": {
"get": {
"summary": "Get list of all cart items",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "List of cart items",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Lead"
}
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community is not found"
}
}
},
"post": {
"summary": "Put lead into cart",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "leadId",
"in": "body",
"description": "ID of lead to be placed into cart",
"schema": {
"type": "integer"
},
"required": true
}
],
"responses": {
"201": {
"description": "Lead was successfully added into cart",
"schema": {
"$ref": "#/definitions/CartItem"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community was not found"
}
}
},
"delete": {
"summary": "Clear shopping cart",
"description": "Remove all pending items from shopping cart",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Shopping cart was successfully cleared"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community was not found"
}
}
}
},
"/api/communities/{communityId}/cartItems/{cartItemId}": {
"delete": {
"summary": "Remove cart item from shopping cart",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "cartItemId",
"in": "path",
"description": "ID of the cart item",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Cart item was successfully removed from shopping cart"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community of cart item was not found"
}
}
}
},
"/api/communities/{communityId}/hours": {
"get": {
"summary": "Get community's working hours",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "List of community's working hours",
"schema": {
"title": "Hours",
"type": "array",
"items": {
"$ref": "#/definitions/CommunityHour"
}
}
},
"404": {
"description": "Community was not found"
}
}
},
"post": {
"summary": "Add new working hours for the community",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "hour",
"in": "body",
"schema": {
"$ref": "#/definitions/CommunityHour"
}
}
],
"responses": {
"201": {
"description": "Create new working hours for community",
"schema": {
"$ref": "#/definitions/CommunityHour"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community was not found"
}
}
}
},
"/api/communities/{communityId}/hours/{hourId}": {
"put": {
"summary": "Update existing working hours of community",
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "hourId",
"in": "path",
"description": "ID of the hours",
"required": true,
"type": "integer"
},
{
"name": "hours",
"in": "body",
"schema": {
"$ref": "#/definitions/CommunityHour"
},
"required": true
}
],
"tags": [
"Communities"
],
"responses": {
"200": {
"description": "Working hours were successfully updated",
"schema": {
"$ref": "#/definitions/CommunityHour"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community or community hours was not found"
}
}
}
},
"/api/communities/{communityId}/leads": {
"get": {
"summary": "Get leads related to community",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "type",
"in": "query",
"description": "Choose what type of leads to retrieve. Can be one of ['nearby', 'archived', 'purchased']",
"default": "nearby",
"type": "string"
}
],
"responses": {
"200": {
"description": "List of leads",
"schema": {
"title": "Leads",
"type": "array",
"items": {
"$ref": "#/definitions/Lead"
}
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community was not found"
}
}
}
},
"/api/communities/{communityId}/neighborhoods": {
"get": {
"summary": "Get neighbourhood objects near community",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "List of neighbourhood objects",
"schema": {
"title": "Neighbourhood",
"type": "array",
"items": {
"$ref": "#/definitions/CommunityNeighbourhood"
}
}
},
"404": {
"description": "Community was not found"
}
}
}
},
"/api/communities/{communityId}/payment": {
"post": {
"summary": "Subscribe to / buy all leads from the shopping cart",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "List of purchased leads",
"schema": {
"title": "Purchased leads",
"type": "array",
"items": {
"$ref": "#/definitions/PurchasedLead"
}
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / user / subscription key / etc. is missing"
}
}
}
},
"/api/communities/{communityId}/purchasedLeads": {
"get": {
"summary": "Get list of community's purchased leads",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "List of purchased leads",
"schema": {
"title": "Purchased leads",
"type": "array",
"items": {
"$ref": "#/definitions/PurchasedLead"
}
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community was not found"
}
}
}
},
"/api/communities/{communityId}/purchasedLeads/{purchasedLeadId}": {
"get": {
"summary": "Get info about single purchased lead",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Single community's purchased lead",
"schema": {
"$ref": "#/definitions/PurchasedLead"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / purchased lead was not found"
}
}
},
"put": {
"summary": "Update info on the community's purchased lead",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
},
{
"name": "purchasedLead",
"in": "body",
"description": "Purchased Lead fields to update",
"schema": {
"$ref": "#/definitions/PurchasedLead"
}
}
],
"responses": {
"200": {
"description": "Purchased Lead successfully updated",
"schema": {
"$ref": "#/definitions/PurchasedLead"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / Purchased Lead was not found"
}
}
}
},
"/api/communities/{communityId}/purchasedLeads/{purchasedLeadId}/carers": {
"get": {
"summary": "Get list of carers attached to purchased lead",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "List caregivers attached to purchased lead",
"schema": {
"title": "Caregivers",
"type": "array",
"items": {
"$ref": "#/definitions/Caregiver"
}
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community or purchased lead was not found"
}
}
},
"post": {
"summary": "Create new carer for purchased lead",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
},
{
"name": "carer",
"in": "body",
"description": "Caregiver JSON to post",
"required": true,
"schema": {
"$ref": "#/definitions/Caregiver"
}
}
],
"responses": {
"201": {
"description": "Successfully created and attached new carer to purchased lead",
"schema": {
"$ref": "#/definitions/Caregiver"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / purchased lead was not found"
}
}
}
},
"/api/communities/{communityId}/purchasedLeads/{purchasedLeadId}/carers/{carerId}": {
"get": {
"summary": "Get info about single carer",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
},
{
"name": "carerId",
"in": "path",
"description": "ID of the carer",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Info about carer attached to purchased lead",
"schema": {
"$ref": "#/definitions/Caregiver"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / purchased lead / carer was not found"
}
}
},
"put": {
"summary": "Update carer info",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
},
{
"name": "carerId",
"in": "path",
"description": "ID of the carer",
"required": true,
"type": "integer"
},
{
"name": "carer",
"in": "body",
"description": "Caregiver fields to be updated",
"schema": {
"$ref": "#/definitions/Caregiver"
}
}
],
"responses": {
"200": {
"description": "Caregiver successfully updated",
"schema": {
"$ref": "#/definitions/Caregiver"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / purchased lead / carer was not found"
}
}
},
"delete": {
"summary": "Delete carer",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
},
{
"name": "carerId",
"in": "path",
"description": "ID of the carer",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Caregiver successfully deleted"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / purchased lead / carer was not found"
}
}
}
},
"/api/communities/{communityId}/purchasedLeads/{purchasedLeadId}/events": {
"get": {
"summary": "Get list of events associated with purchased lead",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "List of events associated with purchased lead",
"schema": {
"title": "Events",
"type": "array",
"items": {
"$ref": "#/definitions/Caregiver"
}
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / purchased lead was not found"
}
}
},
"post": {
"summary": "Create new event associated with purchased lead",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
},
{
"name": "event",
"in": "body",
"description": "Event JSON to post",
"required": true,
"schema": {
"$ref": "#/definitions/Event"
}
}
],
"responses": {
"200": {
"description": "New event successfully created",
"schema": {
"$ref": "#/definitions/Caregiver"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / purchased lead was not found"
}
}
}
},
"/api/communities/{communityId}/purchasedLeads/{purchasedLeadId}/events/{eventId}": {
"delete": {
"summary": "Delete event",
"tags": [
"Communities",
"Leads"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"required": true,
"type": "integer"
},
{
"name": "purchasedLeadId",
"in": "path",
"description": "ID of the purchased lead",
"required": true,
"type": "integer"
},
{
"name": "eventId",
"in": "path",
"description": "ID of the event",
"required": true,
"type": "integer"
}
],
"responses": {
"200": {
"description": "Event successfully deleted"
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / purchased lead / event was not found"
}
}
}
},
"/api/communities/{communityId}/reviews": {
"get": {
"summary": "Get list of reviews for the community",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
}
],
"responses": {
"200": {
"description": "list of all community reviews",
"schema": {
"title": "Reviews",
"type": "array",
"items": {
"$ref": "#/definitions/CommunityReview"
}
}
}
}
},
"post": {
"summary": "Add new community review",
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
},
{
"name": "CommunityReview",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CommunityReview"
}
}
],
"tags": [
"Communities"
],
"responses": {
"201": {
"description": "New review successfully created",
"schema": {
"$ref": "#/definitions/CommunityReview"
}
},
"401": {
"description": "User is not authenticated"
},
"404": {
"description": "Community was not found"
}
}
}
},
"/api/communities/{communityId}/reviews/{reviewId}": {
"put": {
"summary": "Update existing review",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
},
{
"name": "reviewId",
"in": "path",
"description": "ID of the review",
"type": "integer",
"required": true
},
{
"name": "CommunityReview",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CommunityReview"
}
}
],
"responses": {
"200": {
"description": "Review successfully updated",
"schema": {
"$ref": "#/definitions/CommunityReview"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community / review was not found"
}
}
}
},
"/api/communities/{communityId}/rooms": {
"get": {
"summary": "get list of community's rooms",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
}
],
"responses": {
"200": {
"description": "List of rooms",
"schema": {
"title": "Rooms",
"type": "array",
"items": {
"$ref": "#/definitions/Room"
}
}
},
"404": {
"description": "Community was not found"
}
}
},
"post": {
"summary": "Add new room for the community",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
},
{
"name": "room",
"in": "body",
"description": "Room JSON to post",
"required": true,
"schema": {
"$ref": "#/definitions/Room"
}
}
],
"responses": {
"201": {
"description": "New room successfully created",
"schema": {
"$ref": "#/definitions/Room"
}
},
"401": {
"description": "User is not authenticated"
},
"403": {
"description": "User is forbidden to perform action"
},
"404": {
"description": "Community was not found"
}
}
}
},
"/api/communities/{communityId}/rooms/{roomId}": {
"get": {
"summary": "Get info about single community's room",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true
},
{
"name": "roomId",
"in": "path",
"description": "ID of the room",
"type": "integer",
"required": true
}
],
"responses": {
"200": {
"description": "Info about single room",
"schema": {
"$ref": "#/definitions/Room"
}
},
"404": {
"description": "Community / room was not found"
}
}
},
"put": {
"summary": "Update info about community's room",
"tags": [
"Communities"
],
"parameters": [
{
"name": "communityId",
"in": "path",
"description": "ID of the community",
"type": "integer",
"required": true