NAV
Shell HTTP JS PHP C# Java

List of APIs for Remote Execution Service v1.0

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Authentication

Notification

Create Notification

Code samples

# You can also use wget
curl -X POST /service/notifications/notifications \
  -H 'Content-Type: application/json-patch+json' \
  -H 'Accept: application/json' \
  -H 'api-version: string' \
  -H 'Tenant: API_KEY' \
  -H 'Authorization: API_KEY'

POST /service/notifications/notifications HTTP/1.1

Content-Type: application/json-patch+json
Accept: application/json
api-version: string

const inputBody = '{
  "source": {
    "id": "string",
    "name": "string"
  },
  "notification": {
    "type": "Information",
    "content": "string"
  },
  "targetFilters": [
    {
      "locationId": "1a5515a3-ba81-4a42-aee7-ad9ffc090a54",
      "persons": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ],
      "positions": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ]
    }
  ]
}';
const headers = {
  'Content-Type':'application/json-patch+json',
  'Accept':'application/json',
  'api-version':'string',
  'Tenant':'API_KEY',
  'Authorization':'API_KEY'
};

fetch('/service/notifications/notifications',
{
  method: 'POST',
  body: inputBody,
  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

<?php

require 'vendor/autoload.php';

$headers = array(
    'Content-Type' => 'application/json-patch+json',
    'Accept' => 'application/json',
    'api-version' => 'string',
    'Tenant' => 'API_KEY',
    'Authorization' => 'API_KEY',
);

$client = new \GuzzleHttp\Client();

// Define array of request body.
$request_body = array();

try {
    $response = $client->request('POST','/service/notifications/notifications', array(
        'headers' => $headers,
        'json' => $request_body,
       )
    );
    print_r($response->getBody()->getContents());
 }
 catch (\GuzzleHttp\Exception\BadResponseException $e) {
    // handle exception or api errors.
    print_r($e->getMessage());
 }

 // ...

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

/// <<summary>>
/// Example of Http Client
/// <</summary>>
public class HttpExample
{
    private HttpClient Client { get; set; }

    /// <<summary>>
    /// Setup http client
    /// <</summary>>
    public HttpExample()
    {
      Client = new HttpClient();
    }


    /// Make a dummy request
    public async Task MakePostRequest()
    {
      string url = "/service/notifications/notifications";

      string json = @"{
  ""source"": {
    ""id"": ""string"",
    ""name"": ""string""
  },
  ""notification"": {
    ""type"": ""Information"",
    ""content"": ""string""
  },
  ""targetFilters"": [
    {
      ""locationId"": ""1a5515a3-ba81-4a42-aee7-ad9ffc090a54"",
      ""persons"": [
        ""497f6eca-6276-4993-bfeb-53cbbbba6f08""
      ],
      ""positions"": [
        ""497f6eca-6276-4993-bfeb-53cbbbba6f08""
      ]
    }
  ]
}";
      NotificationDefinition content = JsonConvert.DeserializeObject(json);
      await PostAsync(content, url);


    }

    /// Performs a POST Request
    public async Task PostAsync(NotificationDefinition content, string url)
    {
        //Serialize Object
        StringContent jsonContent = SerializeObject(content);

        //Execute POST request
        HttpResponseMessage response = await Client.PostAsync(url, jsonContent);
    }



    /// Serialize an object to Json
    private StringContent SerializeObject(NotificationDefinition content)
    {
        //Serialize Object
        string jsonObject = JsonConvert.SerializeObject(content);

        //Create Json UTF8 String Content
        return new StringContent(jsonObject, Encoding.UTF8, "application/json");
    }

    /// Deserialize object from request response
    private async Task DeserializeObject(HttpResponseMessage response)
    {
        //Read body 
        string responseBody = await response.Content.ReadAsStringAsync();

        //Deserialize Body to object
        var result = JsonConvert.DeserializeObject(responseBody);
    }
}

URL obj = new URL("/service/notifications/notifications");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /service/notifications/notifications

Body parameter

{
  "source": {
    "id": "string",
    "name": "string"
  },
  "notification": {
    "type": "Information",
    "content": "string"
  },
  "targetFilters": [
    {
      "locationId": "1a5515a3-ba81-4a42-aee7-ad9ffc090a54",
      "persons": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ],
      "positions": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ]
    }
  ]
}

Parameters

Name In Type Required Description
api-version query string false none
api-version header string false none
body body NotificationDefinition false none

Example responses

200 Response

true

Responses

Status Meaning Description Schema
200 OK Success boolean
400 Bad Request Bad Request ProblemDetails
401 Unauthorized Unauthorized ProblemDetails

Schemas

NotificationContentDefinition

{
  "type": "Information",
  "content": "string"
}

Properties

Name Type Required Restrictions Description
type NotificationType false none none
content string¦null false none none

NotificationDefinition

{
  "source": {
    "id": "string",
    "name": "string"
  },
  "notification": {
    "type": "Information",
    "content": "string"
  },
  "targetFilters": [
    {
      "locationId": "1a5515a3-ba81-4a42-aee7-ad9ffc090a54",
      "persons": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ],
      "positions": [
        "497f6eca-6276-4993-bfeb-53cbbbba6f08"
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
source SourceDefinition true none none
notification NotificationContentDefinition false none none
targetFilters [TargetFilterDefinition]¦null false none none

NotificationType

"Information"

Properties

Name Type Required Restrictions Description
anonymous string false none none

Enumerated Values

Property Value
anonymous Information
anonymous Announcement
anonymous Warning

ProblemDetails

{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}

Properties

Name Type Required Restrictions Description
additionalProperties any false none none
type string¦null false none none
title string¦null false none none
status integer(int32)¦null false none none
detail string¦null false none none
instance string¦null false none none

SourceDefinition

{
  "id": "string",
  "name": "string"
}

Properties

Name Type Required Restrictions Description
id string true none none
name string¦null false none none

TargetFilterDefinition

{
  "locationId": "1a5515a3-ba81-4a42-aee7-ad9ffc090a54",
  "persons": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ],
  "positions": [
    "497f6eca-6276-4993-bfeb-53cbbbba6f08"
  ]
}

Properties

Name Type Required Restrictions Description
locationId string(uuid)¦null false none none
persons [string]¦null false none none
positions [string]¦null false none none