Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Search service request by filtering metadata

Description

Retrieve a list of service requests ServiceRequestCollectionDTO including service request filtered by metadata.

Notes:
1) Metadata structure should be defined for the service
2) Matching will ignore cases however where applicable accents must be specified in "SearchValue"

...

Task<ServiceRequestCollectionDTO> SearchServiceRequestSearchServiceRequestMetadata(ServiceRequestSearchDTO ServiceRequestSearchMetadataDTO serviceRequestSearchDTO)

Returns

Task<ServiceRequestCollectionDTO>

API Endpoint

[POST] v1/api/servicerequests/search-metadata/

Parameters

Type

Description

serviceRequestSearchDTO

ServiceRequestSearchDTOServiceRequestSearchMetadataDTO

Object used to filter service request metadata

Detail

The parameter, serviceRequestSearchDTOServiceRequestSearchMetadataDTO, consists of the following properties

Properties

Type

Description

Page

integer

The page number to be retrieved

PageSize

integer

Number of entries on a page

UserId

integer

User who has created the service request

ServiceId

integer

The service where the service request belongs

SearchValue

string

A string that will be used to list service request by matching metadata

SearchOptionStructureColumnKeyName

string

A string that represents the KeyName in metadata structure used to determine which structure column will be filtered.

OrganizationId

integer

The organization associated to the service. This field is optional

Note:

  1. SearchValue can be partial and should be minimum two characters in length after trimming.

  2. SearchOption StructureColumnKeyName determines the column structure to use for filtering metadata (i.e for Service 60, we want to filter by "project name" or "nom du projet"). It can be spedified in English or French.

  3. OrganizationId is optional.

Code Block
//This is an exemple to search a service request by filtering metadata with partial search value.
//It will filter metadata of service requests for service id 11.
/*Note: 
  - Service id 11 has metadata structure defined.
  - SearchValue and StructureColumnKeyName are case insensitive
  - Both langauge is accepted for SearchOption
  - Always retrieve service request with metadata
*/   

var serviceRequestSearchDTO = new ServiceRequestSearchMetadataDTO{
    ServiceId = ServiceId,
    Page = 1,
    PageSize = 10,
    UserId = 3919,
    SearchValue "CONF", //using partial value
    StructureColumnKeyName= "UserId": 0,
  "ServiceId": 11,
  "OrganizationId": 0,
  "ExcludeMetadata": false,
  "Page": 1,
  "PageSize": 25,
  "Filter": "PlaceOfSupply='ON'",
  "Version": 1
}name"
};
            
// Get ServiceRequestCollectionDTO including all service requests with metadata using partial value "CONF".
// and the key name used to filter structure column is "NAME". All KeyName:name value: should contain "CONF"

var serviceRequestCollectionDTO = await serviceRequestManager.SearchServiceRequestMetadata(serviceRequestSearchDTO );

Code Block
//This is an exemple to search a service request by filtering metadata with full search value.
//It will filter metadata of service requests for service id 11.
/*Note: 
  - Service id 11 has metadata structure defined.
  - SearchValue and StructureColumnKeyName are case insensitive
  - Both langauge is accepted for SearchValue and StructureColumnKeyName
  - Always retrieve service request with metadata
*/   

var serviceRequestSearchDTO = new ServiceRequestSearchMetadataDTO{
    ServiceId = ServiceId,
    Page = 1,
    PageSize = 10,
    UserId = 3919,
    SearchValue "TC CONF ON Ottawa - 330 Sparks - 08 - 803 CONF TC",  //using full value
    StructureColumnKeyName = "name"
};
            
// Get ServiceRequestCollectionDTO including all service requests with metadata using full value "TC CONF ON Ottawa - 330 Sparks - 08 - 803 CONF TC".
// and the key name used to filter structure column is "NAME". All KeyName:name value: should match "TC CONF ON Ottawa - 330 Sparks - 08 - 803 CONF TC"

var serviceRequestCollectionDTO = await serviceRequestManager.SearchServiceRequestMetadata(serviceRequestSearchDTO );