Hi,
You have posted in the Partner Center API forum, since your issue is related to SharePoint REST API I suggest you ask over at the dedicated SharePoint REST API forum over here:
https://video2.skills-academy.com/en-us/answers/topics/office-sharepoint-server-development.html
----------
(If the reply was helpful please don't forget to accept as answer, thank you)
Best regards,
Leon