Hi @Nishant Khandelwal ,
Per my test, the Permission Request XML in the article is incomplete. The correct XML should be like following
<AppPermissionRequests AllowAppOnlyPolicy="true">
<AppPermissionRequest Scope="http://sharepoint/content/sitecollection" Right="FullControl" />
</AppPermissionRequests>
You could recreate a sharepoint app only with the correct XML. And set the request like following
POST https://xxxx.sharepoint.com/sites/xxxxx/\_api/web/folders
Authorization: "Bearer " + accessToken
Accept: "application/json;odata=verbose"
Content-Type: "application/json;odata=verbose"
The body should be like this
{
In your case, you are missing the listname in ServerRelativeUrl.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.