Hello
whtin a CRM online ( sandbox) we attach a synchrone post create plugin where we are calling an external api using an httpclient request
the following issue appear :
any workaround please ?
Hello
whtin a CRM online ( sandbox) we attach a synchrone post create plugin where we are calling an external api using an httpclient request
the following issue appear :
any workaround please ?
using unit test it returns response empty respone= ""
using the trace it doesn't return the response trace==> their is no tracing for the response
using the profiler it returne error system security
the same json and endpoint are well responding using postman
using c# Unit test gives you a 200's status response?
403 status code mean "I know how you are but you don't have the right access to do this" so check the api key you are passing in headers request or bearer token you are creating against your API.
thank you fo the reply
I stop the profiling and testing using the trace and executing the request throw postman (it repond 201)
but throw plugin still having the same issue 403 forbidden
Hi, I assume that the image above it's run within a plugin profile, making calls to external service in plugin profile result in a System.Security.SecurityExceptions when debugging, I sugest do the following:
- Ensure your plugin is build in .Net Framework 4.6.2 or greater
- Test your service but using Unit Tests, XUnit, MSTests... or using a client (Postman, Insomnia, etc) and ensure it responds correctly, the status codes will tell you.... (200,202,400,etc)
- You could log your request using ITracingService from plugins so you will be able to do something like "TracingService.Trace(json);" and copy the request and use it in the step mentioned before.
regards.
If it was helpful please consider mark it as verified answer
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,252 Super User 2024 Season 2
Martin Dráb 228,089 Most Valuable Professional
nmaenpaa 101,148