Hawksearch v4.0 - Hierarchy API

Hierarchy API Methods

Upsert

The Upsert method is used to insert hierarchy records.  The hierarchy records are often categories or departments. There is a limit of 125 hierarchy objects that can be sent in a request.  This method can be called multiple times to accommodate more than 125.  After all hierarchy objects have been sent, the hierarchy/rebuild method can be used.

Endpoint

Method

Header Key

Endpoint

Method

Header Key

api/hierarchy/upsert

POST

Content-Type: application/json

Name

Data Type

Required

Description

Name

Data Type

Required

Description

IndexName

string

required

Name of the index in which the hierarchy is being built

Hierarchies

Array of objects

required

See Hierarchy Object section.

Rebuild

The Rebuild method is used to initialize hierarchy mapping. 

Endpoint

Method

Header Key

Endpoint

Method

Header Key

api/hierarchy/rebuild

POST

Content-Type: application/json

Name

Data Type

Required

Description

Name

Data Type

Required

Description

IndexName

string

required

Name of the index in which the hierarchy is being built

Delete All

The method removes all hierarchy items. After all hierarchy objects have been removed, the hierarchy/rebuild method can be used.

Endpoint

Method

Header Key

Endpoint

Method

Header Key

api/hierarchy/delete-all

POST

Content-Type: application/json

Delete Items

The Delete Items method removes multiple documents from a specific hierarchy based on ids. After hierarchy objects have been removed, the hierarchy/rebuild method can be used.

Retrieve Hierarchy

This method can be used to verify the hierarchy that has been created.

Objects

Hierarchy Object


Description

ObjectData TypeAlwaysDescription

HierarchyId

String

Yes

Unique identifier for the hierarchy entry

Name

String

Yes

Display name for the hierarchy entry

ParentHierarchyId

String

Yes

The HierarchyId of the parent hierarchy for this hierarchy entry.  If this hierarchy entry is a top-level, the value passed should be "0".

IsActive

Boolean

No

Indicates if the hierarchy entry is active and should be displayed.  It is not required to send inactive hierarchies, but some product systems generate them for sending.

SortOrder

Number

No

Integer to use for sorting the hierarchy entries for display

Custom

String

No

Placeholder for custom implementation use




Hierarchy API Examples

Please follow this page for details - Hierarchy API Examples