Cases

FileTags

FileTags are how we categorize the case filesystem and is primarily a method of easily and quickly retrieving files relevant for the integrator. Additionally, it allows the broker company to only give an integrator access to files with a tag that is shared with them. This can be set up directly in the Core-system by the administrators. A file can have multiple tags. There exists system tags and non-system tags,

  • System tags has a unique enum category Examples of system tags are
    1. Prospect (Salgsoppgave)
    2. SaleAgreement (Oppdragsavtale)
    3. SelfDeclaration (Egenerklæringsskjema)
  • Non-system tags only has a name and is not necessarily unique We have the possibility to specify that a specific integrator only has access to files with certain tags.

You can get a list of available filetags using the following request:

GET /flow/api/FileTags

The response contains both the id of available filetags along with other useful information such its as name, e.g.

[
    {
        "Id": 3,
        "Name": "Salgsoppgave",
        ...
    },
    ...
]

Traversing folders

All cases can have files attached such as prospectus, various documents, and images. You can retrieve folders which files can be placed under using the request:

GET /flow/api/Cases/{caseId}/Directory

A response may contain both files and folders. Both files and folder will in addition to other data contain an id, e.g.

[
    {
        "Id": "d66d974b-33b6-4f7f-a795-cacd62dcbfd5",
        "Type": "Folder"
        ...
    },
    {
        "Id": "das2974b-sd2a-f22a-sd3a-asdd2a9chf8s",
        "Type": "Folder"
        ...
    },
    {
        "Id": "c8501a85-762b-452e-bc54-5c7c8b99097f",
        "Type": "File"
        ...
    },
    ...
]

Note that you can distinguish folders from files by looking at its type.

Using the id of a folder, you can continue traversing the folders using the request

GET /flow/api/Cases/{caseId}/Directory/{folderId}

Download a case file

You can download a file using its id using the following request:

GET /flow/api/Cases/{caseId}/Files/{fileId}

Search directory by FileTag

POST /flow/api/Integrations/Cases/{caseGuid}/Files

Parameter

  • Guid: Case GUID
    • Can be retrieved via search or similar

Body

  • Tags: List<string>

Get all case files with a FileTag shared with my API-user

POST /flow/api/Integrations/Cases/{caseGuid}/Files

Parameter

  • Guid: Case GUID
    • Can be retrieved via search or similar.

Body

  • Tags: List<string>

Get or create a folder on a case or contact

Get or create a new folder in the file system on a case, often used in combination with adding a file to that folder afterwards. If the folder already exists in the file system it will return information about the existing folder instead of creating a new one with the same name.

POST /flow/api/Cases/{caseId}/Directory

Parameter

  • CaseId: int

Body

  • Type: “Folder”
    • Always have Type = “Folder”
  • Name: string
    • Folder name

Response
DirectoryItem

image

Upload a case file

You can upload a file to a specified case folder by using

POST /flow/api/Cases/{caseId}/Directory/{folderId}/File

With the following form data:

request: {
    "TagIds": []
}
file: (binary)

You may attach one or multiple tags to the file by including the ids of the filetags you wish to attach in the POST request for uploading a file:

...
request: { "TagIds": [3] }
...

Edit file on a case

Edit file properties of a file, such as adding tags or renaming files.

PATCH /flow/api/Directories/{fileId}/Properties/{type}/{contextId}
  • fileId: Guid
  • type = “Case”
  • contextId: int
  • CaseId

Body

  • TagCategories: List<TagCategoryType>
    • There exists a lot of “system tags” that has their own unique TagCategory (enum).
    • Ask for which one to use
  • TagIds
    • Id of tag to add on file
    • Can be used in addition to TagCategories to add tags that doesn’t have a enum category type

Delete file on a case

Delete a file from a case

DELETE /flow/api/Cases/{caseId}/File/{fileId}