Skip to main content

Fetch Report Tags

Retrieves report tags from the server based on the given request, allowing users to access relevant tags for categorization or reporting purposes.

Steps to fetch report tags

  1. Create a GetReportTagsRequest object using the GetReportTagsRequest class by passing all the required parameters.
  2. Call getReportTags() function using the instance of LMFeedClient.
  3. Process the response LMResponse<GetReportTagsResponse> as per your requirement.
// Create an object of GetReportTagsRequest using the builder pattern
let request = GetReportTagsRequest.builder()
.type(1) // Specify the type as per your requirement
.build()

LMFeedClient.shared.getReportTags(request: request) { response in
if let result = response?.data {
// Handle success
print("Fetched tags: \(result.tags ?? [])")
} else if let error = response?.error {
// Handle error
print("Error fetching tags: \(error.localizedDescription)")
}
}

Models

GetReportTagsRequest

VARIABLETYPEDESCRIPTIONOPTIONAL
typeIntThe type of report tags to retrieve

GetReportTagsResponse

VARIABLETYPEDESCRIPTIONOPTIONAL
tags[ReportTag]List of retrieved report tag objects✔️

ReportTag

VARIABLETYPEDESCRIPTIONOPTIONAL
idIntUnique identifier of the report tag✔️
nameStringName of the report tag✔️