Naar de hoofdinhoud

Workspace 365 API (omgeving)

Deze week bijgewerkt

Inleiding

De Workspace 365 API maakt gebruik van een REST-achtige interface, wat betekent dat u in plaats van acties/methoden aan te roepen, de actie die u op een resource wilt uitvoeren definieert via de HTTP-METHODE (d.w.z. GET, POST, PUT & DELETE) en JSON gebruikt als dataprotocol.

In dit artikel bespreken we de verschillende soorten beschikbare Workspace API's en hoe je deze kunt gebruiken. Eerst moet er een API-sleutel worden aangemaakt. In plaats van één API-sleutel voor één functionaliteit (bijv. integraties of activiteiten), kun je meerdere sleutels aanmaken. Met deze functie kun je activiteiten van verschillende partijen ontvangen - een unieke sleutel voor elke partij. Dit draagt bij aan de veiligheid.

Vereisten

Een omgevingsbeheerder kan de API configureren op de API-instellingenpagina. Om de API te kunnen gebruiken, moeten de volgende voorwaarden worden vervuld:

  • Zorg ervoor dat de API-instelling is geconfigureerd en ingeschakeld in de instellingen.


Authenticatie

Elk verzoek aan de API moet worden geauthentiseerd met de token die gegenereerd is op de API-instellingenpagina. Elke omgeving vereist zijn eigen token.

Gebruik voor authenticatie de standaard HTTP Authorization-header met het "Workspace365" authenticatieschema en token als referenties:

Authorization: Workspace365 {token}

Bijv. Authorization:

Workspace365 00000000-0000-0000-0000-000000000000

Het wordt sterk aanbevolen om de API niet te gebruiken via niet-https-kanalen.

Authenticatie responscodes

De API reageert met de volgende HTTP-statuscodes in geval van authenticatiefouten:

Code

Beschrijving

200

Reactie OK

400

Validatieprobleem, controleer het gegevensformaat van de foutrespons

401, 403

Authenticatieprobleem. Een van de volgende situaties is van toepassing:

De Authorization-header ontbreektHet authenticatieschema is onjuistHet token is ongeldig voor de omgevingDe API is niet geconfigureerd voor de omgeving of de omgeving is inactief

500

Interne serverfout. Dit kan worden veroorzaakt door het doorgeven van een onjuist gegevensobject

Foutreacties

Wanneer een actie niet kan worden uitgevoerd vanwege onjuiste invoergegevens, zal de respons een HTTP-statuscode 400 bevatten met een JSON-object met de eigenschappen "globalError" en "fieldErrors".

De eigenschap "globalError" wordt ingesteld op een niet-nul object in geval van een validatiefout die niet is gekoppeld aan een specifiek veld. Dit is een JSON-object met een eigenschap "message" die een mogelijk menselijk leesbare foutbeschrijving bevat.

De eigenschap "fieldErrors" wordt ingesteld als sommige veldwaarden de validatie niet hebben doorstaan. Voor elk veld dat faalt, zal er een eigenschap zijn met dezelfde naam als in de invoer, die een JSON-object bevat met een eigenschap "message" die een mogelijk menselijk leesbare foutbeschrijving bevat.

Menselijk leesbare berichten kunnen worden gegeven in een van de talen die door Workspace 365 worden ondersteund, als het verzoek een overeenkomstige Accept-Language-header bevat.


API-sleutel

Om een nieuwe API-sleutel aan te maken:

  1. Ga naar de beheerdersinstellingenpagina van Workspace.

  2. Ga naar Integraties.

  3. Selecteer API-instellingen.

  4. Vink het selectievakje Inschakelen aan.

  5. Vul een naam in (bijv. "API-sleutel voor Yammer-integratie").

  6. Selecteer de reikwijdte van de sleutel.

  7. Klik op Opslaan om de sleutel te genereren.

  8. Kopieer de sleutel.

    • Wanneer je dit dialoogvenster sluit, kun je de sleutel niet meer uit Workspace ophalen. Zorg er dus voor dat je deze sleutel ergens veilig opslaat.

new_api_key.PNG
key_copy.PNG


API-sleutel is gecompromitteerd of vergeten (API-sleutel opnieuw genereren)

Wanneer de API-sleutel wordt gegenereerd, wordt deze niet langer opgeslagen in de Workspace. Als de API-sleutel is gecompromitteerd of vergeten, kunt u de sleutel opnieuw genereren. Het bewerken van de bestaande sleutels geeft u alleen de optie om de naam te wijzigen, de reikwijdte van de sleutel te wijzigen of deze tijdelijk uit te schakelen.

Bij het opnieuw genereren van de sleutel werkt de oude sleutel niet meer. U krijgt het onderstaande dialoogvenster te zien.

regenerate_key.png


APIs

Activiteiten Feed

Endpoints

POST

/{EnvironmentName}/api/activities

Maakt een nieuwe activiteit aan voor een gegeven gebruiker.

Naam

Gelegen in

Beschrijving

Vereist

Schema

Omgevingsnaam

Path

Naam van de omgeving

Ja

string

Activiteit

Body

Activiteit om te creëren

Ja

Activity

Reactie

Code

Beschrijving

Schema

200

The Activity is created

{ id:   integer  The id of the activity which is created user: {   id:   integer    The id of the user   upn:   string    The upn of the activity which is createdNote: Either id or upn should be specified (not both)   } }

400

Array of Validation Results

ApiErrorResponse

401, 403

Authentication issue

500

Internal server error

Voorbeeldverzoek

POST https://workspace365instance.url/{EnvironmentName}/api/activities HTTP/1.1 Accept: application/json Content-Length: 228 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Workspace365 00000000-0000-0000-0000-000000000000    {   "User": {       "Upn": "[email protected]"   },   "Icon": {       "Name": "Phone"   },   "Title": "Test activity",   "Url": "https://workspace365instance.url",
"Tag": "Proposals", "Color": { "Kind": "1", "Value": "#00ff00"
},
"Actions": [
{
"Kind": "1",
"Title": "Accept proposal",
"Url": "https://workspace365instance.url/proposal/accept" }
]
}

Voorbeeldreactie

HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 66{    "id": 916,    "user": {        "id": 1,        "upn": "[email protected]"    } }

POST

/{EnvironmentName}/api/activities-batch

Creëert een nieuwe activiteit voor een bepaalde groep gebruikers

Naam

Gelegen in

Beschrijving

Vereist

Schema

Omgevingsnaam

Path

Naam van de omgeving

Ja

string

Activiteit

Body

Activiteit om te creëren

Ja

Batch Activity

Reactie

Code

Beschrijving

Schema

200

The Activity is created

[{   id:   integer    The id of the activity which is created   user: {       id:     integer      The id of the user     upn:     string      The upn of the activity which is created   } } ,   … ]

400

Array of Validation Results

ApiErrorResponse

401, 403

Authentication issue

500

Internal server error

Voorbeeld verzoek

POST https://workspace365instance.url/{EnvironmentName}/api/activities-batch HTTP/1.1 Accept: application/json Content-Length: 258 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Workspace365 00000000-0000-0000-0000-000000000000{  "Scope": {
"Kind": 0 }, "Data": { "Title": "test", "Url": "https://workspace365instance.url",
"Tag": "Proposals", "Icon": { "Name": "Phone" }, "Color": { "Kind": 1, "Value": "#00ff00" },
"Actions": [
{
"Kind": 1
"Title": "Accept Proposal",
"Url": "https://workspace365instance.url/proposal/accept" }
] }
}

Voorbeeld reactie

HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 628[     {         "id": 962,         "user": {             "id": 1,             "upn": "[email protected]"         }     },     … ]

Schema's

GEEN

Activiteitenschema

{
"User": UserLookup,
"Icon": Icon,
"Title": "Test activity",
"Url": "https://workspace365instance.url",
"Tag": "Proposals",
"Color": Color,
"Actions": [
Action
]
}

Property

Type

Optional/Required

Description

User

UserLookup

Required

Specifies the user for the activity.

Icon

Icon

Optional

Specifies the icon which is displayed in the activity. The default icon is displayed when no icon is specified.

Title

String

Required

The title which is displayed in the activity feed.

Url

String

Optional

A url to a page which shows more details about this activity. If a url is specified the activity feed shows ‘View details’.

Tag

String

Optional

A way to indicate what group the activity belongs to. If one is specified, the activity is grouped with other activities with the same tag. If none is specified, the activity will put in the "Other" group.

Color

Color Object

Optional

The default color is used when not specified.

Actions

Array of Action

Optional

Specifies a list of actions. The maximum number of actions is 2.

NONE

User schema

{  "User": {    "id": 1,    "upn": "[email protected]"    } }

Property

Type

Optional/Required

Description

id

Integer

Optional

Specifies the id of the user. Note: id or upn should be specified.

upn

String

Optional

Specifies the upn of the user. Note: id or upn should be specified.

NONE

Icon schema

{   "Name": "my icon" }

Property

Type

Optional/Required

Description

Name

String

Optional

Specifies the name of the icon. The default icon is displayed when no name is specified.

NONE

Color schema

{   "Kind": "1",   "Value": "#00ff00" }

Property

Type

Optional/Required

Description

Kind

Int

Required

Options are 1 (custom), 2 (primary), 3 (header).

Value

String

Required when Kind is 1

The Value property specifies a html color. The field is required when the Kind is 1.

NONE

Action schema

{  "Kind": 1,    "Title": "Accept proposal",    "Url": “https://workspace365instance.url/propasal/accept" }

Property

Type

Optional/Required

Description

Kind

Int

Required

This property determines which icon is shown next to the action title.

Options are: 1 (check), 2 (cancel), 3 (add), 4 (open), 5 (edit), 6 (manage), 7 (delete), 8 (forward), 9 (backward).

Title

String

Required

Specifies the title of the action. Maximum length is 32 characters.

Url

String

Required

The url the user is redirected to when invoking the action.

NONE

Batch Activity schema

{
"Scope": Scope,
"Data": ActivityWithoutUser
}

Property

Type

Optional/Required

Description

Scope

Scope

Required

Specifies the scope of users.

Data

ActivityWithoutUser

Required

Specifies the upn of the user. Note: id Specifies activity data.

NONE

Scope schema

{
"Kind": 0,
"Users": [
UserLookup
],
"Groups": [
GroupLookup
]
}

Property

Type

Optional/Required

Description

Kind

Int

Required

Specifies the scope kind. Possible values: 0 (all users), 1 (users), 2 (groups).

Users

Array of UserLookup

Required when Kind is 1

his property is required when the scope kind is set to 1. The array should contain at least one user.

Groups

Array of GroupLookup

Required when Kind is 2

This property is required when the scope kind is set to 2. The array should contain at least one group.

NONE

UserLookup schema

{
"id": 1,
"upn": "[email protected]"
}

Property

Type

Optional/Required

Description

Id

Int

Required when upn is not specified

Specifies the user by Id. The Id or the upn should be specified. If both are specified, the Id is used.

Upn

String

Required when Id is not specified

Specifies the user by upn. The Id or the upn should be specified. If both are specified, the Id is used.

NONE

GroupLookup schema

{
"id": 1,
"name": "test-group"
}

Property

Type

Optional/Required

Description

Id

Int

Required when Name is not specified

Specifies the group by Id. The Id or the Name should be specified. If both are specified, the Id is used.

Name

String

Required when Id is not specified

Specifies the group by Name. The Id or the Name should be specified. If both are specified, the Id is used.

NONE

ActivityWithoutUser schema

{
"Icon": Icon,
"Title": "Test activity",
"Url": "https://workspace365instance.url",
"Color": Color,
"Actions": [
Action
]
}

Property

Type

Optional/Required

Description

Icon

Icon

Optional

Specifies the icon which is displayed in the activity. The default icon is displayed when no icon is specified.

Title

String

Required

The title which is displayed in the activity feed.

Url

String

Optional

A url to a page which shows more details about this activity. If a url is specified, the activity feed shows ‘View details’.

Tag

String

Optional

A way to indicate what group the activity belongs to. If one is specified, the activity is grouped with other activities with the same tag. If none is specified, the activity will put in the "Other" group.

Color

Color

Optional

The default color is used when not specified.

Actions

Array of Action

Optional

Specifies a list of actions. The maximum number of actions is 2.


Beschikbare gebruikersapps

GET

/{EnvironmentName}/api/users/{upn}/apps

Gets all the available apps for the given user upn

Name

Located in

Description

Required

Schema

Environment name

Path

Name of the environment

Yes

string

UPN

Path

User upn

Yes

string

Code

Description

Schema

200

The available apps are returned

[{   appId:     integer      The app id   type:     integer      The app type   icon: {        name:      string       The name of the icon      }   appName:     string      The name of the app   url:     string      The URL of the app     NOTE: The URL can be null   color: {        kind:      integer       The type of color used     value:      string       The hex value for the color.      NOTE: This field is present only          when the color kind is       custom.(Kind=1)     }  }  ,    …  ]                

401, 403

Authentication failure

404

Validation issue

ApiErrorResponse

500

Internal server error

Voorbeeld verzoek

GET https://workspace365instance.url/example/api/users/[email protected]/apps
Authorization: Workspace365 00000000-0000-0000-0000-000000000000

Voorbeeld reactie

HTTP/1.1 200 OKContent-Type: application/json; charset=utf-8Content-Length: 66[ {    "appId": 34,   "type": 21,   "icon": {     "name": "Computer Desktop"   },   "appName": "TestClientlessRDP",   "url": "https://workspace365instance.url/example/AppLink/Go/00000000-0000-0000-0000-000000000000",   "color": {     "kind": 1,     "value": "#ff0000"   }  }]

Mapping

NONE

App Kind Mapping

App Kind Integer Value

Color Kind Integer Value

0

Shortcut

1

Email

2

Document

15

Citrix App

20

Azure App

35

Local App

36

Windows Virtual desktop

NONE

Color Kind Mapping

Color Kind Integer Value

Color Kind Integer Value

1

Custom

2

Primary

3

Header


Mededelingen

Get Mededelingen

Endpoint

GET

/{EnvironmentName}/api/announcements

Haalt informatie op over mededelingen

Naam

Locatie

Beschrijving

Vereist

Schema

Naam van ommgeving

Path

Naam van de omgeving

Ja

String

Bereik mededelingencategorie

Path

Mededelingen om te ontvangen

Ja

Announcement category

Authenticatieresponscodes

De API reageert met de volgende HTTP-statuscodes in geval van authenticatiefouten:

Code

Beschrijving

Schema

200

The list has been retrieved

400

Validation issue

ApiErrorResponse

401

Authentication failure

ApiErrorResponse

403

The "Announcements API" scope is not configured for the provided authentication token or the environment is inactive

ApiErrorResponse

500

Internal server error

ApiErrorResponse

Voorbeeldverzoek dat alle mededelingen ophaalt

Accept: application/json

Content-Length: 9082

Content-Type: application/json

Host: workspace365instance.url

Authorization: Workspace365 00000000-0000-0000-0000-000000000000

Voorbeeld response dat alle mededelingen toont

{
"items": [
{
"id": 7322,
"title": "Test Announcement",
"media": null,
"descriptionPreview": "This is an example",
"category": {
"id": 1026,
"name": " Workspace 365"
},
"publicationStart": "2024-11-05T16:09:32.4153805+00:00",
"publicationEnd": null,
"author": null,
"pinDate": null,
"statistics": null
},
{
"id": 7321,
"title": " Test Announcement ",
"media": {
"kind": 1,
"name": "Workspace.png",
"blobId": "6c4442d6-29b7-4f6f-8a0d-b9a238b4ab17_Workspace.png"
},
"descriptionPreview": " This is an example ",
"category": {
"id": 1026,
"name": "Workspace 365"
},
"publicationStart": "2024-11-05T15:48:15.1808344+00:00",
"publicationEnd": null,
"author": null,
"pinDate": null,
"statistics": null
}
],
"nextPageToken": "eyJpZCI6MjI2Miwic3RhcnRUaW1lIjoiMjAyMy0xMC0yNFQwOTozNTozMS42MyswMDowMCJ9"
}

Voorbeeld request dat de mededelingen van een specfieke categorie en alle parameters heeft

Accept: application/json

Content-Length: 9082

Content-Type: application/json

Host: workspace365instance.url

Authorization: Workspace365 00000000-0000-0000-0000-000000000000

Voorbeeld output die een mededeling toont van een specifieke categorie en alle parameters heeft

{
"items": [
{
"id": 5312,
"title": " Test Announcement",
"media": {
"kind": 1,
"name": "8000x4500default.jpg",
"blobId": "c3c7ee1c-12bc-422b-89e8-75a10ebf7cb7_8000x4500default.jpg"
},
"descriptionPreview": "This is a test",
"category": {
"id": 1024,
"name": "Workspace 365"
},
"publicationStart": "2024-07-11T12:36:41.477+00:00",
"publicationEnd": null,
"author": {
"id": 22,
"name": "Example user",
"upn": "[email protected]"
},
"pinDate": null,
"statistics": {
"viewsCount": 1,
"reactionsCount": 0,
"commentsCount": 0
}
}
],
"nextPageToken": null
}

Parameters

Bereik mededelingencategorie

Property

Type

Optional/Required

Description

pageSize

Query

Optional

The max amount of items to return.

minimum: 1

maximum: 100

default: 25

example: 10

pageToken

Query

Optional

The token of the page to retrieve.

The token of the page to retrieve NOTE: the previous page response includes this as the "nextPageToken" field

categories

Query

Optional

For what categories you want to list announcement.

This must be done by category ID. The ID can be found in the URL of the category.

include

String

Optional

What additional references need to be included.

At the moment this only includes “statistics”

Get announcements blob

Endpoint

GET

/{EnvironmentName}/api/announcement -blobs/{blobId}

Haalt de afbeelding van een specifieke mededeling.

Naam

Locatie

Beschrijving

Vereist

Schema

Environment name

Path

Name of the environment

Ja

String

blobId

Body

Blob/picture to retieve from a specific announcement.

This ID can be found using the GET Announcements API.

Ja

String

Authenticatieresponscodes

De API reageert met de volgende HTTP-statuscodes in geval van authenticatiefouten:

Code

Description

Schema

200

The list has been retrieved

400

Validation issue

ApiErrorResponse

401

Authentication failure

ApiErrorResponse

403

The "Announcements API" scope is not configured for the provided authentication token or the environment is inactive

ApiErrorResponse

500

Internal server error

ApiErrorResponse

Voorbeeldverzoek dat alle mededelingen ophaalt

GET https://workspace365instance.url/example /api/announcement-blobs/1ad05393-d2c3-47b4-bce7-8c9f38513c86_Workspace.png/content HTTP/1.1

Accept: application/json

Content-Length: 9082

Content-Type: application/json

Host: workspace365instance.url

Authorization: Workspace365 00000000-0000-0000-0000-000000000000

De response zou nu een afbeelding moeten tonen van de gewenste mededeling. Als dat niet het geval is, controleer je GET verzoek en resolve and problems.

Post mededeling

Endpoint

POST

/{EnvironmentName}/api/announcements?version=2.0

Maakt een nieuwe mededeling

Naam

Locatie

Beschrijving

Vereist

Schema

Environment name

Path

Name of the environment

Yes

string

Announcement

Body

Announcement to create

Yes

Announcement

Authenticatieresponscodes

De API reageert met de volgende HTTP-statuscodes in geval van authenticatiefouten:

Antwoorden

Code

Description

Schema

200

The list has been retrieved

{
id:
integerThe id of the announcement which is created
}

400

Validation issue

ApiErrorResponse

401

Authentication failure

ApiErrorResponse

403

The "Announcements API" scope is not configured for the provided authentication token or the environment is inactive

ApiErrorResponse

Foutreactie

Wanneer een actie niet kan worden uitgevoerd vanwege onjuiste invoergegevens, zal de response een HTTP-statuscode 400 bevatten met een JSON-object dat een “globalError”- en “fieldErrors”-eigenschap bevat.

De eigenschap “globalError” wordt ingesteld op een niet-nul-object in het geval van een validatiefout die niet aan een specifiek veld is gekoppeld. Het is een JSON-object met een “message”-eigenschap die mogelijk een voor de gebruiker leesbare foutbeschrijving bevat.

De eigenschap “fieldErrors” wordt ingesteld als sommige veldwaarden de validatie niet doorstaan. Voor elk dergelijk veld is er een eigenschap met dezelfde naam als in de invoer, die een JSON-object bevat met een “message”-eigenschap met mogelijk een voor de gebruiker leesbare foutbeschrijving.

Leesbare foutberichten kunnen worden gegeven in een van de talen die door Workspace 365 worden ondersteund, mits het verzoek een bijbehorende Accept-Language-header bevat.

Voorbeeld verzoek

POST https://workspace365instance.url/example/api/announcements HTTP/1.1
Accept: application/json
Content-Length: 9082
Content-Type: application/json
Host: workspace365instance.url
Authorization: Workspace365 00000000-0000-0000-0000-000000000000

{
"Title": "My announcement",
"Description": "This is my <b>announcement</b>",
"Media":
{
"MediaKind": 1,
"Image":
{
"Filename": "Minions.jpg",
"Uri": "data:image/jpeg;base64,/--base 64 image data here --"
}
},
"Category":
{
"Id": 2
},
"ShowPopupDirectlyToUser": true,
"AllowComments": true,
"StartTime": "2021-04-15T00:00Z",
"EndTime": "2021-04-18T00:00Z"
}

Voorbeeld reactie

HTTP/1.1 200 OKContent-Type: application/json; charset=utf-8Content-Length: 66{   "id": 916}

Schemas

NONE

Mededeling schema

{
"Title": "My announcement",
"Description": "This is my announcement",
"Media": Media,
"Category": Category,
"ShowPopupDirectlyToUser": true,
"AllowComments": true,
"StartTime": "2021-04-15T00:00Z",
"EndTime": "2021-04-18T00:00Z"
}

Eigenschap

Type

Optional/Required

Beschrijving

Title

String

Required

Specifies the title of the announcement.

Description

String

Optional

Specifies the description of the announcement.

Media

Media

Optional

Specifies the media to be added to the announcement.

Category

Category

Required

Specifies the category of the announcement.

ShowPopupDirectlyToUser

Boolean

Optional

Specifies whether to show the announcement as a popup. The default value is false.

AllowComments

Boolean

Optional

Specifies whether comments are enabled for the announcement. The default value is true.

StartTime

DateTimeOffset

Optional

Specifies the start date and time for the announcement.

EndTime

DateTimeOffset

Optional

Specifies the end date and time for the announcement.

NONE

Media schema

{
"MediaKind": 1,
"Image": Image
}

OR{
"MediaKind": 2,
"VideoEmbedCode": "<iframe width=\"424\" height=\"238\" src=\"https://www.youtube.com/embed/1uDQQVnrDqI\" title=\"YouTube video player\"
frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"
allowfullscreen></iframe>"
}

Property

Type

Optional/Required

Description

MediaKind

Integer

Optional

Specifies the type of media to be attached. Can be 0 (none), 1 (image) or 2 (video).

Image

Image

Required when MediaKind=1

Specifies the details of the image to be added. To be provided only if MediaKind = 1.

VideoEmbedCode

String

Required when MediaKind=2

Specifies the embed code of the video to be added. To be provided only if MediaKind = 2.

NONE

Image schema

{
"Filename": "Minions.jpg",
"Uri": "data:image/jpeg;base64,/--base 64 image data here --"
}

Property

Type

Optional/Required

Description

Filename

String

Required

Specifies the name of the image.

Uri

String

Required

Specifies the base 64 URI of the image.

NONE

Category schema

{
"Id": 1,
"Name": “Company"
}

Property

Type

Optional/Required

Description

Id

Integer

Optional*

Specifies the id of the category.

Name

String

Optional*

Specifies the name of the category.

* Slechts één van de opties moet worden doorgegeven. Als geen van beide wordt doorgegeven, wordt de aankondiging standaard toegevoegd aan "Un-categorized".


Evenementen

Endpoint

GET

/{EnvironmentName /api/events

Haalt informatie op over evenementen

Naam

Locatie

Beschrijving

Vereist

Schema

Environment name

Path

Name of the environment

Yes

String

Events category scope

Path

Events to retrieve.

Yes

Events category

Authenticatieresponscodes

De API reageert met de volgende HTTP-statuscodes in geval van authenticatiefouten:

Code

Beschrijving

Schema

200

The list has been retrieved

400

Validation issue

ApiErrorResponse

401

Authentication failure

ApiErrorResponse

403

The " Events API" scope is not configured for the provided authentication token or the environment is inactive

ApiErrorResponse

500

Internal server error

ApiErrorResponse

Voorbeeldverzoek dat alle evenementen ophaalt

Accept: application/json

Content-Length: 9082

Content-Type: application/json

Host: workspace365instance.url

Authorization: Workspace365 00000000-0000-0000-0000-000000000000

Voorbeeld reactie dat alle evenementen toont

{
"items": [
{
"id": 1945,
"title": "Event",
"media": null,
"descriptionPreview": null,
"category": {
"id": 1019,
"name": "Events Online"
},
"startDate": "2023-08-09T22:00:00+00:00",
"endDate": "2023-08-30T22:00:00+00:00",
"author": {
"id": 1,
"name": "Example user",
"upn": "[email protected]"
},
"eventType": 1,
"location": null
},
{
"id": 2274,
"title": "Testing Events",
"media": {
"kind": 1,
"name": "116abda59844a4565d84fbdbd1a86f357778bc111267152e63ce758113981e35.png",
"blobId": "ed9be29b-4b0c-46bd-978b-07118cfe95b5_116abda59844a4565d84fbdbd1a86f357778bc111267152e63ce758113981e35.png"
},
"descriptionPreview": "Testing this event",
"category": {
"id": 1019,
"name": "Events Online"
},
"startDate": "2023-12-23T23:00:00+00:00",
"endDate": "2023-12-24T13:30:00+00:00",
"author": {
"id": 1,
"name": "Example user",
"upn": "[email protected]"
},
"eventType": 3,
"location": "Online"
}
],
"nextPageToken": null
}

Voorbeeld verzoek dat evenementen van een bepaalde categorie toont en dat alle parameters heeft

GET https://workspace365instance.url/example /api/events?&startDate=2024-11-05T12%3A00%3A00.000Z..2026-11-07T12%3A00%3A00.000Z&endDate=2024-11-09T12%3A00%3A00.000Z..2026-11-10T12%3A00%3A00.000Z HTTP/1.1

Accept: application/json

Content-Length: 9082

Content-Type: application/json

Host: workspace365instance.url

Authorization: Workspace365 00000000-0000-0000-0000-000000000000

Voorbeeld output dat evenementen van een bepaalde categorie toont dat alle parameters heeft

{
"items": [
{
"id": 7323,
"title": "Nieuwe event",
"media": {
"kind": 1,
"name": "Workspace-365-named-logo (128x128).png",
"blobId": "9c4a7c40-e8bf-437f-85f2-bf1dda38258e_Workspace365namedlogo 128x128.png"
},
"descriptionPreview": "Dit is een test Dit is een test Dit is een test Dit is een test Dit is een test Dit is een test Dit is een test Dit is een test Dit is een test Dit i…",
"category": {
"id": 1022,
"name": "Events Hybrid"
},
"startDate": "2025-04-15T22:00:00+00:00",
"endDate": "2025-06-27T22:00:00+00:00",
"author": {
"id": 1,
"name": "Admin van de Geest",
"upn": "[email protected]"
},
"eventType": 3,
"location": "Hybrid location"
}
],
"nextPageToken": null
}

Parameters

Events category scope

Eigenschap

Type

Optional/Required

Beschrijving

pageSize

Query

Optional

The max amount of items to return.

minimum: 1

maximum: 100

default: 25

example: 10

pageToken

Query

Optional

The token of the page to retrieve.

The token of the page to retrieve NOTE: the previous page response includes this as the "nextPageToken" field

categories

Query

Optional

For what categories you want to list announcement.

This must be done by category ID. The ID can be found in the URL of the category.

startDate

String

Optional

For what start date range you want to list events

Format: 2024-11-08T12:00:00.000Z..2024- 2024-11-09T12:00:00.000Z

endDate

String

Optional

For what end date range you want to list events

Format: 2024-11-08T12:00:00.000Z..2024- 2024-11-09T12:00:00.000Z


Endpoint

GET

/{EnvironmentName}/api/event -blobs/{blobId}

Haalt de afbeelding op van een specifiek evenement

Naam

Locatie

Beschrijving

Vereist

Schema

Environment name

Path

Name of the environment

Ja

String

blobId

Path

Blob/picture to retieve from a specific event.

This ID can be found using the GET Announcements API.

Ja

String

Authenticatieresponscodes

De API reageert met de volgende HTTP-statuscodes in geval van authenticatiefouten:

Code

Beschrijving

Schema

200

The list has been retrieved

400

Validation issue

ApiErrorResponse

401

Authentication failure

ApiErrorResponse

403

The "Event API" scope is not configured for the provided authentication token or the environment is inactive

ApiErrorResponse

500

Internal server error

ApiErrorResponse

Voorbeeld verzoek dat alle evenementen ophaalt

GET https://workspace365instance.url/example / api/event-blobs/9c4a7c40-e8bf-437f-85f2-bf1dda38258e_Workspace365namedlogo%20128x128.png/content HTTP/1.1

Accept: application/json

Content-Length: 9082

Content-Type: application/json

Host: workspace365instance.url

Authorization: Workspace365 00000000-0000-0000-0000-000000000000

De reactie zou een afbeelding van het gewenste evenement moeten tonen. Als dit niet het geval is, controleer je GET verzoek en resolve and problems.


App-pictogrammen

Dit endpoint voor afbeeldingen is een uitbreiding op de API voor beschikbare gebruikersapps (beschikbaar vanaf V3.30).

Eindpunten

GET

/{EnvironmentName}/api/appicons/{Source}

Haalt een lijst op van alle globale app-pictogrammen

Name

Located in

Description

Required

Schema

Environment name

Path

Name of the environment

Yes

string

Source

Path

Source of the icon. Possible values are global or environment

Yes

String

Code

Description

Schema

200

The available icons are returned

[{
id:
integer
The app icon id
kind:
integer
The icon kind
name:
string
The name of the app icon
}
,
...
]

400

The requested app icon is not found, check error response data format

ApiErrorResponse

401, 403

Authentication failure

500

Internal server error

Voorbeeld verzoek

GET https://workspace365instance.url/example/api/appicons/global
Authorization: Workspace365 00000000-0000-0000-0000-000000000000

Voorbeeld reactie

HTTP/1.1 200 OKContent-Type: application/json; charset=utf-8Content-Length: 171[  {   "id": 1,   "kind":0,   "name":"Box" }, {   "id": 36,   "kind":2,   "name":"Computer Desktop"  }]

GET

/{EnvironmentName}/api/appicons/{Source}/{Id}

Gets information about a specific app icon

Name

Located in

Description

Required

Schema

Environment name

Path

Name of the environment

Yes

string

Source

Path

Source of the icon. Possible values are global or environment

Yes

String

Id

path

Id app icon

Yes

Integer

Code

Description

Schema

200

The app icon info is returned

{
id:
integer
The app icon id
kind:
integer
The icon kind
name:
string
The name of the app icon
}

400

The requested app icon is not found, check error response data format

ApiErrorResponse

401, 403

Authentication failure

500

Internal server error

Voorbeeld verzoek

GET https://workspace365instance.url/example/api/appicons/global/36
Authorization: Workspace365 00000000-0000-0000-0000-000000000000

Voorbeeld reactie

HTTP/1.1 200 OKContent-Type: application/json; charset=utf-8Content-Length: 69{  "id": 36,  "kind":2,  "name":"Computer Desktop"}

GET

/{EnvironmentName}/api/appicons/{Source}/{Id}/content

Gets the content of a specific app icon

Name

Located in

Description

Required

Schema

Environment name

Path

Name of the environment

Yes

string

Source

Path

Source of the icon. Possible values are global or environment

Yes

String

Id

path

Id app icon

Yes

Integer

Code

Description

Schema

200

The available icons are returned

The content of the response contains the app icon data

400

The requested app icon is not found, check error response data format

ApiErrorResponse

401, 403

Authentication failure

500

Internal server error

Voorbeeld verzoek

GET https://workspace365instance.url/example/api/appicons/global/36/content
Authorization: Workspace365 00000000-0000-0000-0000-000000000000

Voorbeeld reactie

HTTP/1.1 200 OKContent-Type: image/svg+xmlContent-Length: 211<svg fill="#fff"  xmlns="http://www.w3.org/2000/svg" viewBox="0 0 76 76"> <path d="M6 57.126h64v6.742H6zm18.628-7.03h26.744v4.306H24.628zM10.444 15.99v30.588h55.112V15.99zm-4.026-3.858H69.58v37.666H6.418z"/></svg>

Icon kind

NONE

Icon kind

Icon Kind Integer Value

Meaning

0

Png image

1

Svg image

2

Svg image


Integratie referenties

Endpoints

POST

/{EnvironmentName}/IntegrationCredentialsApi/User/{Upn}/

Creëert nieuwe integratiereferenties voor de opgegeven gebruiker

Name

Located in

Description

Required

Schema

EnvironmentName

Path

Name of the Environment

Yes

string

Upn

Path

User principal name of the user to create the Integration credentials for

Yes

string

Integration credentials

Body

Integration credentials to create

Yes

{                  username:         string (email)         Username of the Integration credentials        password: string         Password of the Integration credentials           }

Reacties

Code

Description

Schema

200

The Integration credentials were created

{         id:             integer          The id of the Integration credentials which were created }

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

404

The user was not found

Voorbeeld verzoek

POST https://workspace365instance.url/{EnvironmentName}/IntegrationCredentialsApi/User/[email protected]/ HTTP/1.1 Accept: application/json Content-Length: 68 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Workspace365 4613e4c6-aa59-45d0-88c9-c99feddf3959   {   "username": "[email protected]",   "password": "qwerty" }

Voorbeeld reactie

HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Content-Length: 8   {"id":8}

PUT

/{EnvironmentName}/IntegrationCredentialsApi/{Id}/

Updates the credentialset

Parameters

Name

Located in

Description

Required

Schema

EnvironmentName

Path

Name of the Environment

Yes

string

Id

Path

Id of the Integration credentials to update

Yes

integer

Integration credentials

Body

New properties of the Integration credentials

Yes

{         username:          string (email)         Username of the Integration credentials        password:          string         Password of the Integration credentials}

Reacties

Code

Description

Schema

200

The Integration credentials were updated

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

404

The Integration credentials were not found

Voorbeeld verzoek

PUT https://workspace365instance.url/{EnvironmentName}/IntegrationCredentialsApi/8/ HTTP/1.1 Accept: application/json Content-Length: 68 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Workspace365 4613e4c6-aa59-45d0-88c9-c99feddf3959   {   "username": "[email protected]",   "password": "qwerty_updated" } 

Voorbeeld reactie

HTTP/1.1 200 OK Content-Length: 0


ActiveDirectorySync

Eindpunten

PUT

/{EnvironmentName}/ActiveDirectorySyncAPI/Users/{ObjectId}/

Maakt een nieuwe gebruiker aan

Name

Located in

Description

Schema

EnvironmentName

Path

Name of the Environment

string

ObjectId

Path

ObjectId of the user

Guid

User Info

Body

User Info to create

{

"FirstName": "Sarah",
"LastName": "de Vries",
"UserPrincipalName": "[email protected]",
"Email": "[email protected]",
"SecondaryEmail": "[email protected]",
"IsAdmin": "false",
"IsActive": "true",
"JobTitle": "",
"MobilePhone": ""

}

Reacties

Code

Description

Schema

200

The user is created

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

Voorbeeld verzoek

PUT https://workspace365instance.url/{EnvironmentName}/ActiveDirectorySyncAPI/Users/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/ HTTP/1.1 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==                  {

"FirstName": "Sarah",
"LastName": "de Vries",
"UserPrincipalName": "[email protected]",
"Email": "[email protected]",
"SecondaryEmail": "[email protected]",
"IsAdmin": "false",
"IsActive": "true",
"JobTitle": "",
"MobilePhone": ""

}

Voorbeeld reactie

HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8

DELETE

/{EnvironmentName}/ActiveDirectorySyncAPI/Users/{ObjectId}/

Verwijdert de opgegeven gebruiker

Name

Located

Description

Required

Schema

EnvironmentName

Path

Name of the Environment

Yes

string

ObjectId

Path

ObjectId of the user

Yes

Guid

Reacties

Code

Description

Schema

200

The user is deleted

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

Voorbeeld verzoek

DELETE https://workspace365instance.url/{EnvironmentName}/ActiveDirectorySyncAPI/Users/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/ HTTP/1.1 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==

Voorbeeld reactie

HTTP/1.1 200 OK

PUT

/{EnvironmentName}/ActiveDirectorySyncAPI/Groups/{ObjectId}/

Creëert een nieuwe groep

Name

Located in

Description

Schema

EnvironmentName

Path

Name of the Environment

string

ObjectId

Path

ObjectId of the group

Guid

Group info

Body

Group info to create

{

"Name": "Finance",
"Description": "Everyone from Finance"

}

Reacties

Code

Description

Schema

200

The group is created

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

Voorbeeld verzoek

PUT https://workspace365instance.url/{EnvironmentName}/ActiveDirectorySyncAPI/Groups/9acasd74-0599-45ac-b0fe-a0aa0b9a00a/ HTTP/1.1 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==
{

"Name": "Finance",
"Description": "Everyone from Finance"

}

Voorbeeld reactie

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

DELETE

/{EnvironmentName}/ActiveDirectorySyncAPI/Groups/{ObjectId}/

Verwijderd de opgeven groep

Name

Located

Description

Required

Schema

EnvironmentName

Path

Name of the Environment

Yes

string

ObjectId

Path

ObjectId of the group

Yes

Guid

Reacties

Code

Description

Schema

200

The group is deleted

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

Voorbeeld verzoek

DELETE https://workspace365instance.url/{EnvironmentName}/ActiveDirectorySyncAPI/Groups/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/ HTTP/1.1 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==

Voorbeeld reactie

HTTP/1.1 200 OK

PUT

/{EnvironmentName}/ActiveDirectorySyncAPI/Groups/{ObjectID}/Users/{ObjectID}

Plaats de gebruiker in de opgegeven groep

Name

Located

Description

Required

Schema

EnvironmentName

Path

Name of the Environment

Yes

string

Group ObjectId

Path

ObjectId of the group

Yes

Guid

User ObjectId

Path

ObjectId of the user

Yes

Guid

Reacties

Code

Description

Schema

200

The membership is created

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

Voorbeeld verzoek

PUT https://workspace365instance.url/{EnvironmentName}/ActiveDirectorySyncAPI/Groups/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/Users/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/ HTTP/1.1 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==

Voorbeeld reactie

HTTP/1.1 200 OK

DELETE

/{EnvironmentName}/ActiveDirectorySyncAPI/Groups/{ObjectID}/Users/{ObjectID}

Delete user in the given group

Name

Located

Description

Required

Schema

EnvironmentName

Path

Name of the Environment

Yes

string

Group ObjectId

Path

ObjectId of the group

Yes

Guid

User ObjectId

Path

ObjectId of the user

Yes

Guid

Reacties

Code

Description

Schema

200

The membership is deleted

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

Voorbeeld verzoek

DELETE https://workspace365instance.url/{EnvironmentName}/ActiveDirectorySyncAPI/Groups/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/Users/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/ HTTP/1.1 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==

Voorbeeld reactie

HTTP/1.1 200 OK

PUT

/{EnvironmentName}/ActiveDirectorySyncAPI/{ObjectID}/Groups/{ObjectID}

Plaats de groep in de opgegeven groep

Name

Located

Description

Required

Schema

EnvironmentName

Path

Name of the Environment

Yes

string

Target Group ObjectId

Path

ObjectId of the target group

Yes

Guid

Group ObjectId

Path

ObjectId of the group

Yes

Guid

Reacties

Code

Description

Schema

200

The membership is created

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

Voorbeeld verzoek

PUT https://workspace365instance.url/{EnvironmentName}/ActiveDirectorySyncAPI/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/Groups/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/ HTTP/1.1 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==

Voorbeeld reactie

HTTP/1.1 200 OK

DELETE

/{EnvironmentName}/ActiveDirectorySyncAPI/{ObjectID}/Groups/{ObjectID}

Verwijder de groep in de opgegeven groep

Name

Located

Description

Required

Schema

EnvironmentName

Path

Name of the Environment

Yes

string

Target Group ObjectId

Path

ObjectId of the target group

Yes

Guid

Group ObjectId

Path

ObjectId of the group

Yes

Guid

Reacties

Code

Description

Schema

200

The membership is deleted

400

Validation issue

ApiErrorResponse

401, 403

Authentication issue

Voorbeeld verzoek

DELETE https://workspace365instance.url/{EnvironmentName}/ActiveDirectorySyncAPI/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a/Groups/4dcvcd74-9103-45ac-b0fe-a0aa0b1d00a HTTP/1.1 Content-Type: application/json Host: yourworkspace365instance.url Authorization: Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==

Voorbeeld reactie

HTTP/1.1 200 OK

PUT

/{EnvironmentName}/ActiveDirectorySyncAPI/Users/{ObjectID}/ProfilePicture

Upload de profielfoto van de gebruiker.

Opmerking: De profielfoto van de gebruiker is nog niet getest/gedocumenteerd.

Multipartformulier

PUT https://{WorkspaceUrl}/{EnvironmentName}/ActiveDirectorySyncAPI/Users/{ObjectID}/ProfilePicture

DELETE

/{EnvironmentName}/ActiveDirectorySyncAPI/Users/{ObjectID}/ProfilePicture

Verwijder de profielfoto van de gebruiker.

Opmerking: De profielfoto van de gebruiker is nog niet getest/gedocumenteerd.

Multipartformulier

DELETE https://{WorkspaceUrl}/{EnvironmentName}/ActiveDirectorySyncAPI/Users/{ObjectID}/ProfilePicture


Authenticatie

Elk verzoek naar de API moet worden geauthenticeerd met de token die is gegenereerd op de Active Directory instellingenpagina. Elke omgeving vereist zijn eigen token.

Voor authenticatie gebruik de standaard HTTP Authorization header met "Basic" authenticatieschema en de token base64 gecodeerd als referenties:

Authorization: Basic base64({token}:)

Bijvoorbeeld:

Basic NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==

Zorg ervoor dat je de Sync API-authenticatietoken gebruikt en deze codeert naar Base64-formaat, bijvoorbeeld hier. Houd er rekening mee dat je de token moet encoderen inclusief de dubbele punt : Bijvoorbeeld:

  • Token: 4613e4c6-aa59-45d0-88c9-c99feddf3959

  • Tekst om te encoderen: 4613e4c6-aa59-45d0-88c9-c99feddf3959:

    Resultaat: NDYxM2U0YzYtYWE1OS00NWQwLTg4YzktYzk5ZmVkZGYzOTU5Og==

Was dit een antwoord op uw vraag?