
Announcements
When following the docs to create a model-driven power app using code, what steps do I need to take to successfully make this post request below? I am currently getting a status of 401. Where do I find the bearer token?
```
POST [Organization URI]/api/data/v9.0/appmodules HTTP/1.1
Content-Type: application/json; charset=utf-8
OData-MaxVersion: 4.0
OData-Version: 4.0
Accept: application/json
{
"name": "SDKTestApp",
"uniquename":"SDKTestApp",
"webresourceid":"953b9fac-1e5e-e611-80d6-00155ded156f"
}
```
Hello, thanks for reaching out.
For custom development you need to authenticate to the API using Oauth. This link walks through the requirements. You need to create an application registration in your Azure AD, give it permissions to Dynamics 365 or Dataverse, then create an app user in the Power Platform Admin center. Then you use the client id and secret from the app registration to make a call to get the bearer token which you then pass into your call to the API.
Use OAuth authentication with Microsoft Dataverse (Dataverse) - Power Apps | Microsoft Learn
If this helped please mark as a solution or give a kudos.
Have a wonderful day!