Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

Version 2 of APIs are available in release 5.1 and later.

Use version 5.1.4 and later for Swagger.

Overview

Version 2 of API to access information supports json. Use 2 for version. Documentation is available using swagger. Please refer to:

https://www.domain.com/AssertWeb/swagger

In selected APIs it is possible to select how information is returned, as ID or as href. APIs with this option accepts the parameter itemType.

public enum ExportResponseItemType
    {
        Default = 0,
        Id = 1,
        Href = 2,
    }

Sample usage

Use case: Search catalogues

POST /api/v{version}/{culture}/{site}/SearchCatalogues

Try simple search request. Search string can be catalogue name, description or identity.

{ "query": "searchstring" }

Response will be a list of catalogue IDs.

Use case: Get all catalogues

GET /api/v{version}/{culture}/{site}/Catalogues

Call will return all catalogues as a list. Use parameter itemType to select if list is ID (itemType undefined or 1) or href (itemType 2).

Use case: Get a full catalogue

GET /api/v{version}/{culture}/{site}/Catalogue/{id}

ID is the id returned in the Search catalogues call. Response will he the meta data on the catalogue, nodes structure and URLs to modules, documents and parts in the catalogue. Use these URLs to get modules, parts and documents.

Configuration

Authentication is controlled by standard authentication methods, see https://signifikant.atlassian.net/wiki/spaces/ASKB/pages/901578756/Technical+documentation+-+Signifikant+REST+API+authentication?src=search.

Which information is actually possible to access using the API is controlled by a configuration file

AssertWeb/AppData/SITE/api-export-settings.config

Settings for the API

<?xml version="1.0"?>
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <ExportSettings settings-id="default" 
     max-items="2147483647"
     specifications="FACTORYCODE,XYZ"
     excluded-specifications="SECRET"
     result-set="true" 
     id="false" 
     persistent-id="true" 
     identity="true" 
     label="true" 
     permissions="true"
     permissions-disabled="false"
     translations="true" 
     href="true" 
     value-separator="," 
     bulletins="true" 
     footnotes="true" 
     filters="true"
     filters-disabled="false"
     brands="false" 
     images="true" 
     item-status="false" 
     hot-spots="true" 
     part-assembly-rows="true" 
     part-assembly-illustrations="true" 
     catalogue-nodes="true">
  </ExportSettings>
</Settings>

Attribute

Values

Usage

settings-id

string

Name of the setting. Is used to connect users in api-permissions with export settings.

max-items

int

Limit on number of root elements

specifications

string, true or false

List of specifications defined by code. Each listed specification will be included in the api resposes.

true will make all specifications to be included. false will make API remove all specifications.

excluded-specifications

string

List of specifications defined by code. Each listed specification will be excluded in the api resposes.

result-set

true/false

True will make API return a list of objects also when list contains only one object. This is default.

False will make API return only the object if result is only one and a list otherwise.

permissions

true/false

Will permissions be included in API response.

permissions-disabled

string

List of permissions. Do not consider permissions in permissions-disabled list.

Note. Carefully use this setting, it may lead to information leak.

filters

true/false

Will filters be included in API response.

filters-disabled

string

List of filters. Do not consider filters in filters-disabled list.

Note. Carefully use this setting, it may lead to non-filtered information being available on filtered responses.

translations

href

true/false

Include href to information objects.

value-separator

character

<propertyname>

true/false

Determines if property is to be included in API response or not. Eg filters=”false” will ensure filters are not included in API responses.

Settings for connecting systems

API users are connected to export settings and given permissions based on the api-permissions.config. For more information on autentication see https://signifikant.atlassian.net/wiki/spaces/ASKB/pages/901578756/Technical+documentation+-+Signifikant+REST+API+authentication?src=search.

An API user is assigned permissions by the <Permissions> tag and connected to an export setting by the <> tag.

<?xml version="1.0" encoding="utf-8"?>
<ApiPermissionConfiguration xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema>
  <Enabled>true</Enabled>
  <PermissionList>
    <ApiPermission>
      <Enabled>true</Enabled>
      <Username>admin</Username>
      <Passsword>admin</Passsword>
      <Roles>WebSynchronizerApi,WebPublisherApi,PublisherApi, Api ,WebApiAdmin, ApiUpload</Roles>
      <Permissions>EMEA</Permissions>
      <AllowAnonymous>false</AllowAnonymous>
    </ApiPermission>
  </PermissionList>
</ApiPermissionConfiguration>
  • No labels