Cannot create Experience / WebProfile

schattke
New Community Member
Hello, we are working on a PayPal Plus Integration. Login via OAuth, creating Payments, patching, executing, works. But unfortunately, we cannot create an Experience / WebProfile through the API. We work in the sandbox and are using your .Net SDK but also tried with a simple HttpClient. Example with SDK: var oProfile = new PayPal.Api.WebProfile() { presentation = new PayPal.Api.Presentation() { brand_name = "Hello World", locale_code = "DE" }, input_fields = new PayPal.Api.InputFields() { allow_note = false, no_shipping = 0, address_override = 1 } }; var oResponse = oProfile.Create(oContext); Response: Der Remoteserver hat einen Fehler zurückgegeben: (400) Ungültige Anforderung. Example with HttpClient: dynamic oRequest = new ExpandoObject(); oRequest.brand_name = "Hello World"; oRequest.locale_code = "DE"; oRequest.allow_note = false; oRequest.no_shipping = 0; oRequest.address_override = 1; string sJson = Json.Encode(new DynamicJsonObject(oRequest)); var oContent = new StringContent(sJson, UnicodeEncoding.UTF8, "application/json"); HttpClient oClient = new HttpClient(); oClient.SetBearerToken(oToken.AccessToken); var oPut = oClient.PutAsync(sEndpoint + "v1/payment-experience/webprofiles", oContent).Result; sResult = oPut.Content.ReadAsStringAsync().Result; Response: Internal Server Error What could be the problem? Why is there really no form in the backend to create Experiences / WebProfiles? Best Regards Mirko Schattke
Login to Me Too
1 REPLY 1

MTS_Justin
Moderator
Moderator

Hello,

First, request an access token.

Second, edit the request attached to this response to add your own data and then submit the request via cURL. I don't code in .NET so I cannot advise you in that regard.

This works fine for me every time.


Was my post helpful? If so, please give me a kudos!
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.