API Docs
HomeDocsWebsite
  • Home
  • Introduction
    • Authorization
      • Authorize
      • Get a Token
      • Third-Party Login
    • Field Types and Validation
      • Field Types
      • Validation
    • Query Manipulation
      • Constraints
      • Result Control
      • Value Filters
    • Entity Permissions
      • Restricted Scope
  • API reference
    • Infoboard
      • InfoboardChannels
      • InfoboardPosts
      • InfoboardPostSeenUsers
      • InfoboardPostReadUsers
      • InfoboardComments
      • InfoboardDepartmentSettings
    • Manual
      • ManualChapters
      • ManualEntries
      • ManualEntrySeenUsers
    • Calendar
      • Calendars
      • CalendarEvents
    • Filemanager
      • FilemanagerDirectories
      • FilemanagerFiles
    • Files
    • Forms
      • Forms
      • FormFields
      • FormFieldTypes
      • FormFieldValidations
      • FormFieldValidationTypes
      • FormMessages
      • FormMessageFields
    • Layouts
      • Layouts
      • LayoutRows
      • LayoutColumns
      • LayoutColumnLayoutElements
    • Tasks 2.0
      • TaskTemplates
      • TaskFields
      • TaskAssignments
      • TaskExecutions
      • TaskProgressFields
    • Departments
    • Roles
    • Permissions
    • Users
    • EntityPermissions
    • Notifications
    • Reactions
    • Icons
    • Folders
    • SharedItems
    • UrlContext
  • Resources
    • Release Notes
      • v2.106.0
      • v2.102.0
Powered by GitBook
On this page
  • Introduction
  • Structure
  • Types
  • generic
  • internal
  • linkableEntity
  • fileContentEntity
  • sharedItem
  • List
  1. API reference

UrlContext

PreviousSharedItemsNextRelease Notes

Last updated 4 months ago

Introduction

The UrlContext API allows the user to get context information about any given URL.

This can be useful to determine wether a URL is related to an linkable entity or the user is allowed to access it.

Depending on the resolved , context information are provided in a consistent .

Structure

The structure of each URL Context is exactly the same. Wether all information are present depends on the .

Key
Type
Description

key *

string

The provided URL.

type *

string

static_url *

string

The resolved static (never changing) URL.

url *

string

The resolved URL.

provide_information*

boolean

Wether additional information are provided.

title

string

The resolved title.

description

string

The resolved description (HTML).

icon_name

string

image_url

string

The resolved preview image URL.

data

array

Keys with * are always present in the URL Context.

Types

generic

The context for a external URL.

We currently don't provide information for this context type but plan to get title, description and image_url from the Open Graph data of the website.

internal

The context for a internal URL (e.g. /infoboard) always provides the relative URL and allows to differentiate internal from external (generic) URLs. It also includes title and icon_name information for the URL when the user is allowed to view it.

linkableEntity

fileContentEntity

sharedItem

List

List the URL Context for the desired urls.

Definition

POST /api/url-context

Request Keys

Key
Type
Default
Description

urls *

array

-

The URLs to get the context for.

Example Request

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/url-context', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'urls' => [
            'https://www.intratool.de/',
            '/infoboard',
            '/infoboard/eintrag/zn7m24owk63qolxryge8pj05',
            '/files/doxjzrnmgklojd154qwp8602',
            '/geteilte-inhalte/9ae0e631-37b4-4ef0-8a26-1526f329098a'
        ]
    ]
]);

Example Response

[
  {
    "type": "generic",
    "static_url": "https://www.intratool.de/",
    "url": "https://www.intratool.de/",
    "provide_information": false,
    "key": "https://www.intratool.de/"
  },
  {
    "type": "internal",
    "static_url": "/infoboard"",
    "url": "/infoboard"",
    "provide_information": true,
    "title": "Infoboard",
    "description": null,
    "icon_name": "nc-chat-round-content",
    "image_url": null,
    "data": {
      "route": "infoboard"
    },
    "key": "/infoboard"
  },
  {
    "type": "linkableEntity",
    "static_url": "/infoboard/eintrag/zn7m24owk63qolxryge8pj05",
    "url": "/infoboard/eintrag/zn7m24owk63qolxryge8pj05",
    "provide_information": true,
    "title": "Lorem ipsum dolor sit amet",
    "description": null,
    "icon_name": "nc-chat-round-content",
    "image_url": null,
    "data": {
      "type": "infoboardPost",
      "id": 20
    },
    "key": "/infoboard/eintrag/zn7m24owk63qolxryge8pj05"
  },
  {
    "type": "fileContentEntity",
    "static_url": "/files/doxjzrnmgklojd154qwp8602",
    "url": "/files/doxjzrnmgklojd154qwp8602",
    "provide_information": true,
    "title": "Lorem-ipsum.jpg",
    "description": "<strong>Größe:</strong> 150 KB<br><strong>Geändert:</strong> 01.09.2024 12:00",
    "icon_name": "nc-single-folded-content",
    "image_url": "/files/doxjzrnmgklojd154qwp8602",
    "data": {
      "entity_type": "filemanagerFile",
      "entity_id": 15,
      "filename": "Lorem-ipsum.jpg",
      "extension": "jpg",
      "mime_type": "image/jpeg",
      "size": 150000,
      "download_url": "/files/doxjzrnmgklojd154qwp8602?download=true"
    },
    "key": "/files/doxjzrnmgklojd154qwp8602"
  },
  {
    "type": "sharedItem",
    "static_url": "/geteilte-inhalte/9ae0e631-37b4-4ef0-8a26-1526f329098a",
    "url": "/handbuch/lorem-ipsum/#lorem-ipsum-dolor-sit-amet-consectetur-adipiscing-elit",
    "provide_information": true,
    "title": "Lorem ipsum dolor sit amet, consectetur...",
    "description": "<p><strong>Erstellt von:</strong> intratool Service</p><p><strong>Geändert:</strong> 01.01.2024 12:00</p><p></p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>",
    "icon_name": "nc-file-article",
    "image_url": null,
    "data": {
      "type": "manualEntry",
      "targetable_type": "manualEntry",
      "targetable_id": 10,
      "targetable_deleted": false
    },
    "key": "/geteilte-inhalte/9ae0e631-37b4-4ef0-8a26-1526f329098a"
  }
]

The of the URL Context.

The resolved name.

Additional context data based on .

The context for a linkable entity (e.g. ) provides the "readable" URL for the entity. It also includes title, description, icon_name and image_url information for the entity when the user is allowed to view it.

The context for a file content entity (e.g. ) provides the URL to show the file content of the entity. It also includes title, description, icon_name and image_url information for the entity when the user is allowed to view it. The data key also includes information about the filename, extension, mime_type, size and the download_url of the file.

The context for a provides the "readable" URL based on the type of the SharedItem. Wether title, description, icon_name and image_url information are provided depends on the user being authorized to view the shared item.

Form
FilemanagerFile
SharedItem
type
structure
type
Icon
type
type