Forecasting Category Profile Assignments

Forecasting category profiles control which forecast categories a manager can see and assign.

You can assign, update, delete, and retrieve details about Forecasting category profile assignments using operations against the /v1/commons/persons/forecasting_category_profiles resource.

Prerequisites

A person's person ID is the same as the personKey and employee ID, and is not the same as the person number.

The person in this example has a person ID of 100 and a person number of 20190.

Example

In this example, we retrieve a list of available Forecasting category profiles and then assign, verify, update, and delete a person's Forecasting category profile assignments.

Retrieve available Forecasting category profiles

Call GET /v1/forecasting/category_profiles to retrieve a list of all available Forecasting category profiles. The response returned will resemble the example below.

[
  {
    "id": -2,
    "name": "Empty Profile",
    "description": "Profile containing access to no entries.",
    "active": true,
    "version": 1,
    "categories": []
  },
  {
    "id": -1,
    "name": "All Forecast Categories",
    "description": "Profile containing access to all forecast categories",
    "active": true,
    "version": 1,
    "categories": [
      {
        "id": 1801,
        "qualifier": "//Loss Mitigation"
      },
      {
        "id": 473,
        "qualifier": "//Health System"
      },
      {
        "id": 1851,
        "qualifier": "//Loss Mitigation 2"
      },
      {
        "id": 1852,
        "qualifier": "//Loss Mitigation 3"
      },
      {
        "id": 357,
        "qualifier": "//Acme Company"
      },
      {
        "id": 2202,
        "qualifier": "//RootSite"
      },
      {
        "id": 1,
        "qualifier": "//CXORG"
      },
      {
        "id": 3,
        "qualifier": "//Organization"
      },
      {
        "id": 1251,
        "qualifier": "//Corporate"
      },
      {
        "id": 1855,
        "qualifier": "//Region1"
      }
    ]
  },
  {
    "id": 22,
    "name": "Manufacturing Forecast Categories",
    "description": "Profile containing access to all manufacturing Forecast categories",
    "active": true,
    "version": 1,
    "categories": [
      {
        "id": 357,
        "qualifier": "//Acme Company"
      },
      {
        "id": 1855,
        "qualifier": "//Region1"
      }
    ]
  }
]

Create the assignment

The create request:

  • uses personIdentity to identify the person using their person number
  • uses assignmentProfile to define the Forecasting category profile to assign

Example request

Call PUT /v1/commons/persons/forecasting_category_profiles with the following request payload.

{
  "personIdentity": {
    "personNumber": "20190"
  },
   "assignmentProfile": "All Forecast Categories"
}

Example response

A success response returns HTTP status code 200 and a response body similar to the following example.

{
    "personIdentity": {
        "personKey": 100,
        "personNumber": "20190",
        "badgeNumber": "23605"
    },
    "assignmentProfile": {
        "id": -1,
        "qualifier": "All Forecast Categories"
    }
}

Verify the assignment

To verify, you can call GET /v1/commons/persons/forecasting_category_profiles?person_number={personNumber} or GET /v1/commons/persons/forecasting_category_profiles/{personKey}.

Calling GET /v1/commons/persons/forecasting_category_profiles?person_number=20190 or GET /v1/commons/persons/forecasting_category_profiles/100 returns:

{
    "personIdentity": {
        "personKey": 100,
        "personNumber": "20190",
        "badgeNumber": "23605"
    },
    "assignmentProfile": {
        "id": -1,
        "qualifier": "All Forecast Categories"
    }
}

Update the assignment

To update the person's Forecasting category profile assignments, call PUT /v1/commons/persons/forecasting_category_profiles with the following request payload.

Example request

{
  "personIdentity": {
    "personNumber": "20190"
  },
   "assignmentProfile": "Manufacturing Forecast Categories"
}

Example response

{
    "personIdentity": {
        "personKey": 100,
        "personNumber": "20190",
        "badgeNumber": "23605"
    },
    "assignmentProfile": {
        "id": 22,
        "qualifier": "Manufacturing Forecast Categories"
    }
}

Delete an assignment

To delete a Forecasting category profile assignment associated with a person, call DELETE /v1/commons/persons/forecasting_category_profiles with the following request payload.

{
  "personIdentity": {
    "personKey": "100"
  },
  "assignmentProfile": "Manufacturing Forecast Categories"
}

The system returns HTTP status 204 with no response body.