Skip to content

Org Units

lsambridge edited this page May 14, 2025 · 6 revisions

Orginisation Units

Gets the Org Units and their levels that are configured

HTTP Response Values

    200 - Successful call of the api
    400 - Invalid query string parameters

[GET] /v2/meta/orgunitlevels

A successful response looks like:

HTTP/1.1 200 Ok

Location: https://api.myezrewards.com/v2/meta/orgunitlevels

[
    {
        "Name": "Locations",
        "Children": [
            {
                "Name": "Leamington",
                "Children": []
            },
            {
                "Name": "Leicester",
                "Children": []
            }
        ]
    }
]

Get Organizational Unit Levels

[GET] /v2/meta/OrgUnitLevels

HTTP Response Values:

    200 - Successful retrieval of organizational unit levels
    404 - Not Found

Update Organizational Unit Levels

[PATCH] /v2/meta/OrgUnitLevels?useIds=false

Request Body:

[
    {
        "OrgUnitId": "string",
        "Name": "string"
    }
]

Query Parameters:

  • useIds: Boolean indicating whether to use IDs for updating. By supplying an OrgUnitId and the query string parameter useIds, this will create organizational unit levels attached to the parent associated with that ID, even if the organizational unit level name already exists.

HTTP Response Values:

    200 - Successful update of organizational unit levels
    400 - Incorrect or missing org units

Save Organizational Unit Levels

[POST] /v2/meta/OrgUnitLevels

Request Body:

[
    {
        "OrgUnitId": "string",
        "Name": "string"
    }
]

HTTP Response Values:

    200 - Successful save of organizational unit levels
    400 - Incorrect or missing org units

Class Methods

Execute

  • Description: Retrieves metadata for a specified date range.
  • Parameters:
    • HttpContext httpContext: The HTTP context.
    • IMemberServices memberServices: The AccountsUser services.
    • ICountryServices countryServices: The country services.
    • ITelemetryTracker telemetryTracker: The telemetry tracker.
    • IAuditService auditService: The audit service.
    • DateTime fromDate: The start date of the range.
    • DateTime toDate: The end date of the range.

ExecuteOrgUnitLevels

  • Description: Retrieves organizational unit levels for a partner.
  • Parameters:
    • HttpContext httpContext: The HTTP context.
    • IAuditService auditService: The audit service.
    • IMemberServices memberServices: The AccountsUser services.

ExecuteOrgUnitLevelsUpdate

  • Description: Updates organizational unit levels for a partner.
  • Parameters:
    • HttpContext httpContext: The HTTP context.
    • IAuditService auditService: The audit service.
    • IMemberServices memberServices: The AccountsUser services.
    • ITelemetryTracker telemetryTracker: The telemetry tracker.
    • List<OrgUnits> orgUnits: The list of organizational units to update.
    • bool useIds: Whether to use IDs for updating.

ExecuteOrgUnitLevelsSave

  • Description: Saves organizational unit levels for a partner.
  • Parameters:
    • HttpContext httpContext: The HTTP context.
    • IAuditService auditService: The audit service.
    • IMemberServices memberServices: The AccountsUser services.
    • ITelemetryTracker telemetryTracker: The telemetry tracker.
    • List<OrgUnits> orgUnits: The list of organizational units to save.

Summary

The MetaData class serves as a controller for managing metadata and organizational unit levels, providing various endpoints for retrieval, updating, and saving organizational units in the system.

Clone this wiki locally