Overview
This blog post provides best practices guide on how to use the Assignment public API to perform CRUD (Create, Update, Read and Delete) operations for Assignments in resource management capability in SAP Project and Resource Management. It also includes instructions and examples on how to construct the REST call and build the payload for common scenarios.
Setup/Configuration: You should follow the steps mentioned here to set up the API access. While accessing the API make sure you provide the Authorization: Bearer <access token> as part of the Request Headers.
Sections Covered:
1. Maintain assignment with monthly distribution
Use Case: Create a new assignment for a resource request with monthly granularity for more than one month.
As an example, let's create an assignment with staffed efforts of 100 hours each for the months May, June and July in year 2025.
Best Practice: Make one call per assignment and provide details for each month in the payload of same call. Please find technical details and sample payload below.
Consider below details as an example and make sure to adapt to your needs.
HTTP POST: <apiUrl>/AssignmentService/v1/Assignments
Request Body:
{
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"_monthlyAssignmentDistribution": [
{
"calendarMonth": "202505",
"bookedCapacity": 100
},
{
"calendarMonth": "202506",
"bookedCapacity": 100
},
{
"calendarMonth": "202507",
"bookedCapacity": 100
}
]
}
Response:
{
"@context": "$metadata#Assignments(_monthlyAssignmentDistribution())/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-05-01",
"endDate": "2025-07-20",
"bookedCapacity": 300,
"isSoftBooked": false,
"_monthlyAssignmentDistribution": [
{
"assignmentID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"calendarMonth": "202505",
"bookedCapacity": 100,
"monthStartDate": "2025-05-01",
"monthEndDate": "2025-05-31"
},
{
"assignmentID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"calendarMonth": "202506",
"bookedCapacity": 100,
"monthStartDate": "2025-06-01",
"monthEndDate": "2025-06-30"
},
{
"assignmentID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"calendarMonth": "202507",
"bookedCapacity": 100,
"monthStartDate": "2025-07-01",
"monthEndDate": "2025-07-31"
}
]
}
Use Case: Update monthly assignment distribution of existing Assignment.
As an example, let’s execute the following updates to the assignment created above at once:
Leave staffed hours for month 202507 same as before i.e. 100 hours.
Best Practice: Make one call per assignment and provide details for only those months that need an update in the payload of same call. Please find technical details and sample payload below.
Consider below details as an example and make sure to adapt to your needs.
HTTP PATCH: <apiUrl>/AssignmentService/v1/Assignments(37eda2ff-971d-4e03-b4aa-1bcaaa13761a)
Request Body:
{
"_monthlyAssignmentDistribution": [
{
"calendarMonth": "202505",
"bookedCapacity": 0
},
{
"calendarMonth": "202506",
"bookedCapacity": 110
},
{
"calendarMonth": "202508",
"bookedCapacity": 120
}
]
}
Response:
{
"@context": "$metadata#Assignments/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-06-01",
"endDate": "2025-08-20",
"bookedCapacity": 330.00,
"isSoftBooked": false
}
Use Case: Read monthly distribution of assignment.
To read the final monthly distribution of the updated assignment, we can execute a read with the assignment ID while expanding the monthly assignment distribution as shown below:
HTTP GET: <apiUrl>/AssignmentService/v1/Assignments(37eda2ff-971d-4e03-b4aa-1bcaaa13761a)?$expand=_monthlyAssignmentDistribution
Response:
{
"@context": "$metadata#Assignments(_monthlyAssignmentDistribution())/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-06-01",
"endDate": "2025-08-20",
"bookedCapacity": 330.00,
"isSoftBooked": false,
"_monthlyAssignmentDistribution": [
{
"assignmentID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"calendarMonth": "202506",
"bookedCapacity": 110,
"monthStartDate": "2025-06-01",
"monthEndDate": "2025-06-30"
},
{
"assignmentID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"calendarMonth": "202507",
"bookedCapacity": 100,
"monthStartDate": "2025-07-01",
"monthEndDate": "2025-07-31"
},
{
"assignmentID": "37eda2ff-971d-4e03-b4aa-1bcaaa13761a",
"calendarMonth": "202508",
"bookedCapacity": 120,
"monthStartDate": "2025-08-01",
"monthEndDate": "2025-08-31"
}
]
}
2. Maintain assignment with weekly distribution
Use Case: Create a new assignment for a resource request with weekly granularity for more than one weeks.
As an example let's create an assignment with staffed efforts of 40 hours for each of the calendar weeks 202525, 202526, 202527.
Best Practice: Make one call per assignment and provide details for each week in the payload of same call. Please find technical details and sample payload below.
Consider below details as an example and make sure to adapt to your needs.
HTTP POST: <apiUrl>/AssignmentService/v1/Assignments
Request Body:
{
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"_weeklyAssignmentDistribution": [
{
"calendarWeek": "202525",
"bookedCapacity": 40
},
{
"calendarWeek": "202526",
"bookedCapacity": 40
},
{
"calendarWeek": "202527",
"bookedCapacity": 40
}
]
}
Response:
{
"@context": "$metadata#Assignments(_weeklyAssignmentDistribution())/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-06-16",
"endDate": "2025-07-06",
"bookedCapacity": 120,
"isSoftBooked": false,
"_weeklyAssignmentDistribution": [
{
"assignmentID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"calendarWeek": "202525",
"bookedCapacity": 40,
"weekStartDate": "2025-06-16",
"weekEndDate": "2025-06-22"
},
{
"assignmentID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"calendarWeek": "202526",
"bookedCapacity": 40,
"weekStartDate": "2025-06-23",
"weekEndDate": "2025-06-29"
},
{
"assignmentID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"calendarWeek": "202527",
"bookedCapacity": 40,
"weekStartDate": "2025-06-30",
"weekEndDate": "2025-07-06"
}
]
}
Use Case: Update weekly distribution of existing assignment. As an example, let's execute the following updates to the assignment created above at once:
Leave staffed hours for calendar week 202527 same as before i.e. 40 hours.
Best Practice: Make one call per assignment and provide details for only those weeks that need an update in the payload of same call. Please find technical details and sample payload below.
Consider below details as an example and make sure to adapt to your needs.
HTTP PATCH: <apiUrl>/AssignmentService/v1/Assignments(147f4fd5-20c2-4e3d-b716-a90a8d5795cf)
Request Body:
{
"_weeklyAssignmentDistribution": [
{
"calendarWeek": "202525",
"bookedCapacity": 0
},
{
"calendarWeek": "202526",
"bookedCapacity": 30
},
{
"calendarWeek": "202528",
"bookedCapacity": 40
}
]
}
Response:
{
"@context": "$metadata#Assignments/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-06-23",
"endDate": "2025-07-13",
"bookedCapacity": 110.00,
"isSoftBooked": false
}
Use Case: Read the weekly distribution details of the updated assignment.
To read the final weekly distribution of the updated assignment, we can execute a read with the assignment ID while expanding the weekly assignment distribution as shown below:
HTTP GET: <apiUrl>/AssignmentService/v1/Assignments(147f4fd5-20c2-4e3d-b716-a90a8d5795cf)?$expand=_weeklyAssignmentDistribution
Response:
{
"@context": "$metadata#Assignments(_weeklyAssignmentDistribution())/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-06-23",
"endDate": "2025-07-13",
"bookedCapacity": 110.00,
"isSoftBooked": false,
"_weeklyAssignmentDistribution": [
{
"assignmentID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"calendarWeek": "202527",
"bookedCapacity": 40,
"weekStartDate": "2025-06-30",
"weekEndDate": "2025-07-06"
},
{
"assignmentID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"calendarWeek": "202526",
"bookedCapacity": 30,
"weekStartDate": "2025-06-23",
"weekEndDate": "2025-06-29"
},
{
"assignmentID": "147f4fd5-20c2-4e3d-b716-a90a8d5795cf",
"calendarWeek": "202528",
"bookedCapacity": 40,
"weekStartDate": "2025-07-07",
"weekEndDate": "2025-07-13"
}
]
}
3. Maintain assignment with daily distribution
Use Case: Create a new assignment for a resource request with daily granularity for more than one day.
As an example, let's create an assignment with staffed efforts of 8 hours for each of three days 5, 6, 7 in May, 2025.
HTTP POST: <apiUrl>/AssignmentService/v1/Assignments
Request Body:
{
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"isSoftBooked": false,
"_dailyAssignmentDistribution": [
{
"date": "2025-05-05",
"bookedCapacity": 8
},
{
"date": "2025-05-06",
"bookedCapacity": 8
},
{
"date": "2025-05-07",
"bookedCapacity": 8
}
]
}
Response:
{
"@context": "$metadata#Assignments(_dailyAssignmentDistribution())/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-05-05",
"endDate": "2025-05-07",
"bookedCapacity": 24,
"isSoftBooked": false,
"_dailyAssignmentDistribution": [
{
"ID": "a7872fe7-4363-4208-b421-b7790b1c021e",
"assignmentID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"date": "2025-05-05",
"calendarWeek": "19",
"calendarMonth": "5",
"calendarYear": "2025",
"bookedCapacity": 8
},
{
"ID": "e853d06c-1f05-4cd3-84b9-c92853a0fb33",
"assignmentID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"date": "2025-05-06",
"calendarWeek": "19",
"calendarMonth": "5",
"calendarYear": "2025",
"bookedCapacity": 8
},
{
"ID": "e9cd8c42-71d6-4ab8-a018-8292706bb836",
"assignmentID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"date": "2025-05-07",
"calendarWeek": "19",
"calendarMonth": "5",
"calendarYear": "2025",
"bookedCapacity": 8
}
]
}
Use Case: Update daily distribution of existing assignment.
As an example, let's execute the following updates to the assignment created above at once:
Leave staffed hours for 2025-05-06 same as before i.e. 8 hours.
Best Practice: Make one call per assignment and provide details for only those days that need an update in the payload of same call. Please find technical details and sample payload below.
Consider below details as an example and make sure to adapt to your needs.
HTTP PATCH: <apiUrl>/AssignmentService/v1/Assignments(b457b28b-0076-47a7-b844-4ecf6ad534ed)
Request Body:
{
"_dailyAssignmentDistribution": [
{
"date": "2025-05-05",
"bookedCapacity": 0
},
{
"date": "2025-05-07",
"bookedCapacity": 4
},
{
"date": "2025-05-08",
"bookedCapacity": 8
}
]
}
Response:
{
"@context": "$metadata#Assignments/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-05-06",
"endDate": "2025-05-08",
"bookedCapacity": 20.00,
"isSoftBooked": false
}
Use Case: Read the modified assignment with daily distribution information.
To read the final daily distribution of the updated assignment, we can execute a read with the assignment ID while expanding the daily assignment distribution as shown below:
HTTP GET: <apiUrl>/AssignmentService/v1/Assignments(b457b28b-0076-47a7-b844-4ecf6ad534ed)?$expand=_dailyAssignmentDistribution
Response:
{
"@context": "$metadata#Assignments(_dailyAssignmentDistribution())/$entity",
"@metadataEtag": "W/\"da5b296a49ea0d38879f6fb2a9cb5ace92b6d1b3098c9b387e2334a3f660f06b\"",
"ID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"requestID": "00031745-860c-4b5c-864e-5c50a2a011c7",
"resourceID": "1a33b6fe-8107-4b68-91fa-828029399fb5",
"startDate": "2025-05-05",
"endDate": "2025-05-08",
"bookedCapacity": 20.00,
"isSoftBooked": false,
"_dailyAssignmentDistribution": [
{
"ID": "e853d06c-1f05-4cd3-84b9-c92853a0fb33",
"assignmentID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"date": "2025-05-06",
"calendarWeek": "202519",
"calendarMonth": "202505",
"calendarYear": "2025",
"bookedCapacity": 8.00
},
{
"ID": "96e760a0-2a57-4c22-b465-53785cf1819f",
"assignmentID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"date": "2025-05-07",
"calendarWeek": "202519",
"calendarMonth": "202505",
"calendarYear": "2025",
"bookedCapacity": 4.00
},
{
"ID": "ee9bf740-55c2-4c8c-9e64-b8dd49f1c34f",
"assignmentID": "b457b28b-0076-47a7-b844-4ecf6ad534ed",
"date": "2025-05-08",
"calendarWeek": "202519",
"calendarMonth": "202505",
"calendarYear": "2025",
"bookedCapacity": 8.00
}
]
}
4. Delete assignment
Use case: Delete the entire assignment along with its distribution.
As an example, the API call below will delete the assignment along with all the distribution (monthly/weekly/daily).
HTTP DELETE: <apiUrl>/AssignmentService/v1/Assignments(089f55e2-fe6e-4575-bb1a-82c0bbe0a968)
Response Status: 204 No Content
5. Further information and resources
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
7 | |
5 | |
5 | |
4 | |
4 | |
4 | |
3 | |
2 | |
2 | |
2 |