{
  "openapi": "3.0.4",
  "info": {
    "title": "Activities API",
    "description": "**Welcome to the Activities API documentation.**\r\n\r\nYou can test the API using **[Swagger](/activities/demo/v10-0/docs/swagger)**.\r\n\r\nYou can find a detailed documentation by following **[this link](https://docs.egov4.ch/docs/9.1/category/activities-api)**.\r\n",
    "contact": {
      "name": "Artionet",
      "url": "https://www.artionet.ch/",
      "email": "support@artionet.com"
    },
    "version": "v10.0",
    "x-logo": {
      "url": "/activities/demo/v10-0/Documentation/Images/logo_artionet.png",
      "backgroundColor": "#fafafa",
      "altText": "Artionet Logo"
    }
  },
  "servers": [
    {
      "url": "/activities/demo/v10-0"
    }
  ],
  "paths": {
    "/activities/{activityId}": {
      "get": {
        "tags": [
          "Activities"
        ],
        "summary": "Get a single activity",
        "description": "Allows to retrieve a specific activity identified by its `Id`.",
        "operationId": "ActivityById",
        "parameters": [
          {
            "name": "activityId",
            "in": "path",
            "description": "Activity `Id`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Selected activity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityDto"
                }
              }
            }
          },
          "404": {
            "description": "Selected activity doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Activities"
        ],
        "summary": "Delete an activity",
        "description": "Allows to delete an existing activity.",
        "parameters": [
          {
            "name": "activityId",
            "in": "path",
            "description": "Activity `Id`",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content"
          },
          "404": {
            "description": "Selected activity doesn't exist",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/activities": {
      "get": {
        "tags": [
          "Activities"
        ],
        "summary": "Get a list of activities",
        "description": "Allows to retrieve a list of activities (GET only) according to certain criteria.",
        "parameters": [
          {
            "name": "OwnerId",
            "in": "query",
            "description": "Filters activities by `OwnerId` property (Profile ID from ePortal)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ServiceIds",
            "in": "query",
            "description": "Filters activities by `ServiceId` property. Using the value `-1` includes the activities without `ServiceId`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "BusinessCaseId",
            "in": "query",
            "description": "Filters activities by `BusinessCaseId` property",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Title",
            "in": "query",
            "description": "Activities with `Title` containing this value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Targets",
            "in": "query",
            "description": "Filters activities by `Target` property. Using the value `NONE` includes the activities without `Target`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Types",
            "in": "query",
            "description": "Filters activities by `Type` property. Using the value `NONE` includes the activities without `Type`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Events",
            "in": "query",
            "description": "Filters activities by `Event` property. Using the value `NONE` includes the activities without `Event`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Modules",
            "in": "query",
            "description": "Filters activities by `Module` property. Using the value `NONE` includes the activities without `Module`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "ObjectId",
            "in": "query",
            "description": "Activities with `ObjectId` containing this exact value.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "MinDisplayStamp",
            "in": "query",
            "description": "Activities with an earlier or equal `DisplayStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MaxDisplayStamp",
            "in": "query",
            "description": "Activities with a later or equal `DisplayStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MinCreationStamp",
            "in": "query",
            "description": "Activities with an earlier or equal `CreationStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MaxCreationStamp",
            "in": "query",
            "description": "Activities with a later or equal `CreationStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "PageNumber",
            "in": "query",
            "description": "Page number",
            "schema": {
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "description": "Number of items per page. Using value `-1` disable pagination and gives all results at once.",
            "schema": {
              "maximum": 2147483647,
              "minimum": -1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "OrderBy",
            "in": "query",
            "description": "Sorting option. \r\n\r\n**Usage (no square brackets !) :** `orderBy=[property] [asc,desc],[property] [asc,desc],...`",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of selected activities (GET only)",
            "headers": {
              "X-Pagination-Total-Count": {
                "description": "Total number of elements",
                "schema": {
                  "type": "integer",
                  "description": "Total number of elements",
                  "format": ""
                }
              },
              "X-Pagination-Page-Size": {
                "description": "Size of a page of element",
                "schema": {
                  "type": "integer",
                  "description": "Size of a page of element",
                  "format": ""
                }
              },
              "X-Pagination-Current-Page": {
                "description": "Index of the current page",
                "schema": {
                  "type": "integer",
                  "description": "Index of the current page",
                  "format": ""
                }
              },
              "X-Pagination-Total-Pages": {
                "description": "Total number of pages",
                "schema": {
                  "type": "integer",
                  "description": "Total number of pages",
                  "format": ""
                }
              },
              "X-Pagination-Next-Page-Link": {
                "description": "Link to the next page",
                "schema": {
                  "type": "string",
                  "description": "Link to the next page",
                  "format": ""
                }
              },
              "X-Pagination-Previous-Page-Link": {
                "description": "Link to the previous page",
                "schema": {
                  "type": "string",
                  "description": "Link to the previous page",
                  "format": ""
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ActivityDto"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "head": {
        "tags": [
          "Activities"
        ],
        "summary": "Get a list of activities",
        "description": "Allows to retrieve a list of activities (GET only) according to certain criteria.",
        "parameters": [
          {
            "name": "OwnerId",
            "in": "query",
            "description": "Filters activities by `OwnerId` property (Profile ID from ePortal)",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "ServiceIds",
            "in": "query",
            "description": "Filters activities by `ServiceId` property. Using the value `-1` includes the activities without `ServiceId`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "integer",
                "format": "int32"
              }
            }
          },
          {
            "name": "BusinessCaseId",
            "in": "query",
            "description": "Filters activities by `BusinessCaseId` property",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Title",
            "in": "query",
            "description": "Activities with `Title` containing this value",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Targets",
            "in": "query",
            "description": "Filters activities by `Target` property. Using the value `NONE` includes the activities without `Target`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Types",
            "in": "query",
            "description": "Filters activities by `Type` property. Using the value `NONE` includes the activities without `Type`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Events",
            "in": "query",
            "description": "Filters activities by `Event` property. Using the value `NONE` includes the activities without `Event`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "Modules",
            "in": "query",
            "description": "Filters activities by `Module` property. Using the value `NONE` includes the activities without `Module`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "ObjectId",
            "in": "query",
            "description": "Activities with `ObjectId` containing this exact value.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "MinDisplayStamp",
            "in": "query",
            "description": "Activities with an earlier or equal `DisplayStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MaxDisplayStamp",
            "in": "query",
            "description": "Activities with a later or equal `DisplayStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MinCreationStamp",
            "in": "query",
            "description": "Activities with an earlier or equal `CreationStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "MaxCreationStamp",
            "in": "query",
            "description": "Activities with a later or equal `CreationStamp`",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "PageNumber",
            "in": "query",
            "description": "Page number",
            "schema": {
              "maximum": 2147483647,
              "minimum": 1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "PageSize",
            "in": "query",
            "description": "Number of items per page. Using value `-1` disable pagination and gives all results at once.",
            "schema": {
              "maximum": 2147483647,
              "minimum": -1,
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "OrderBy",
            "in": "query",
            "description": "Sorting option. \r\n\r\n**Usage (no square brackets !) :** `orderBy=[property] [asc,desc],[property] [asc,desc],...`",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of selected activities (GET only)",
            "headers": {
              "X-Pagination-Total-Count": {
                "description": "Total number of elements",
                "schema": {
                  "type": "integer",
                  "description": "Total number of elements",
                  "format": ""
                }
              },
              "X-Pagination-Page-Size": {
                "description": "Size of a page of element",
                "schema": {
                  "type": "integer",
                  "description": "Size of a page of element",
                  "format": ""
                }
              },
              "X-Pagination-Current-Page": {
                "description": "Index of the current page",
                "schema": {
                  "type": "integer",
                  "description": "Index of the current page",
                  "format": ""
                }
              },
              "X-Pagination-Total-Pages": {
                "description": "Total number of pages",
                "schema": {
                  "type": "integer",
                  "description": "Total number of pages",
                  "format": ""
                }
              },
              "X-Pagination-Next-Page-Link": {
                "description": "Link to the next page",
                "schema": {
                  "type": "string",
                  "description": "Link to the next page",
                  "format": ""
                }
              },
              "X-Pagination-Previous-Page-Link": {
                "description": "Link to the previous page",
                "schema": {
                  "type": "string",
                  "description": "Link to the previous page",
                  "format": ""
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ActivityDto"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Activities"
        ],
        "summary": "Create a new activity",
        "description": "Allows to create a new activity.",
        "requestBody": {
          "description": "Activity to create",
          "content": {
            "application/json": {
              "schema": {
                "allOf": [
                  {
                    "$ref": "#/components/schemas/ActivityForCreationDto"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created activity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActivityDto"
                }
              }
            }
          },
          "400": {
            "description": "Request body is null or synthax is invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Activities"
        ],
        "summary": "Delete activities by criteria",
        "description": "Allows to delete existing activities by criteria.",
        "parameters": [
          {
            "name": "OwnerId",
            "in": "query",
            "description": "Profile Id from ePortal",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Types",
            "in": "query",
            "description": "Filters activities by `Type` property. Using the value `NONE` includes the activities without `Type`.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No content",
            "headers": {
              "X-Deletion-Total-Count": {
                "description": "Number of activities deleted",
                "schema": {
                  "type": "integer",
                  "description": "Number of activities deleted",
                  "format": ""
                }
              },
              "X-Deletion-Ids-List": {
                "description": "Ids of the deleted activities",
                "schema": {
                  "type": "array",
                  "description": "Ids of the deleted activities",
                  "format": ""
                }
              }
            }
          },
          "422": {
            "description": "Model is semantically erroneous",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ActivityDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique ID of the activity",
            "format": "int32"
          },
          "ownerId": {
            "type": "string",
            "description": "Owner's Profile ID (from ePortal)"
          },
          "title": {
            "type": "string",
            "description": "Title of the activity"
          },
          "body": {
            "type": "string",
            "description": "Body message of this activity",
            "nullable": true
          },
          "type": {
            "type": "string",
            "description": "Tag indicating the domain of the activity",
            "nullable": true
          },
          "target": {
            "type": "string",
            "description": "Tag indicating who is targeted by this activity",
            "nullable": true
          },
          "event": {
            "type": "string",
            "description": "Event that triggered this activity",
            "nullable": true
          },
          "module": {
            "type": "string",
            "description": "Module emitting this activity",
            "nullable": true
          },
          "objectId": {
            "type": "string",
            "description": "Identifier of an object related to this activity",
            "nullable": true
          },
          "businessCaseId": {
            "type": "string",
            "description": "ID of the business case linked to this activity",
            "format": "uuid",
            "nullable": true
          },
          "serviceId": {
            "type": "integer",
            "description": "ID of the prestation linked to this activity",
            "format": "int32",
            "nullable": true
          },
          "relatedProfileId": {
            "type": "integer",
            "description": "Identifier of another profile related to this activity",
            "format": "int32",
            "nullable": true
          },
          "displayStamp": {
            "type": "string",
            "description": "Date displayed in the ePortal",
            "format": "date-time"
          },
          "createdBy": {
            "type": "string",
            "description": "Author of this activity"
          },
          "creationStamp": {
            "type": "string",
            "description": "Date of creation (API-sided) of this activity",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "ActivityForCreationDto": {
        "required": [
          "ownerId",
          "title"
        ],
        "type": "object",
        "properties": {
          "ownerId": {
            "minLength": 1,
            "type": "string",
            "description": "Owner's Profile ID (from ePortal)"
          },
          "title": {
            "minLength": 1,
            "type": "string",
            "description": "Title of the activity"
          },
          "body": {
            "type": "string",
            "description": "Body message of this activity",
            "nullable": true
          },
          "type": {
            "maxLength": 60,
            "type": "string",
            "description": "Tag indicating the domain of the activity",
            "nullable": true
          },
          "target": {
            "maxLength": 60,
            "type": "string",
            "description": "Tag indicating who is targeted by this activity",
            "nullable": true
          },
          "event": {
            "maxLength": 255,
            "type": "string",
            "description": "Event that triggered this activity",
            "nullable": true
          },
          "module": {
            "maxLength": 255,
            "type": "string",
            "description": "Module emitting this activity",
            "nullable": true
          },
          "objectId": {
            "maxLength": 36,
            "type": "string",
            "description": "Identifier of an object related to this activity",
            "nullable": true
          },
          "businessCaseId": {
            "type": "string",
            "description": "ID of the business case linked to this activity",
            "format": "uuid",
            "nullable": true
          },
          "serviceId": {
            "maximum": 2147483647,
            "minimum": 1,
            "type": "integer",
            "description": "ID of the prestation linked to this activity",
            "format": "int32",
            "nullable": true
          },
          "relatedProfileId": {
            "type": "integer",
            "description": "Identifier of another profile related to this activity",
            "format": "int32",
            "nullable": true
          },
          "displayStamp": {
            "type": "string",
            "description": "Date displayed in the ePortal",
            "format": "date-time",
            "nullable": true
          },
          "createdBy": {
            "maxLength": 100,
            "type": "string",
            "description": "Author of this activity",
            "default": "iGovPortalDefault",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "HttpValidationProblemDetails": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ProblemDetails"
          },
          {
            "type": "object",
            "properties": {
              "errors": {
                "type": "object",
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            },
            "additionalProperties": { }
          }
        ]
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "URI that identifies the problem detail type",
            "nullable": true
          },
          "title": {
            "type": "string",
            "description": "A short human-readable summary about the problem",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "description": "HTTP Status Code",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "description": "A human-readable explanation about the problem",
            "nullable": true
          },
          "traceId": {
            "type": "string",
            "description": "Guid to trace the error in the log files",
            "format": "uuid"
          }
        },
        "additionalProperties": { }
      }
    }
  },
  "tags": [
    {
      "name": "Activities"
    },
    {
      "name": "activity_model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/ActivityDto\" />",
      "x-displayName": "Activity Model"
    },
    {
      "name": "activity_model_for_creation",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/ActivityForCreationDto\" />",
      "x-displayName": "Activity Creation Model"
    },
    {
      "name": "problem_details_model",
      "description": "<SchemaDefinition schemaRef=\"#/components/schemas/ProblemDetails\" />",
      "x-displayName": "Error Model"
    }
  ],
  "x-tagGroups": [
    {
      "name": "General",
      "tags": [
        "Activities"
      ]
    },
    {
      "name": "Models",
      "tags": [
        "activity_model",
        "activity_model_for_creation",
        "problem_details_model"
      ]
    }
  ]
}