Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Anything equivalent to ForceClient's "ExecuteRestApiAsync"? #46

Open
cemerson opened this issue Oct 15, 2021 · 1 comment
Open

Anything equivalent to ForceClient's "ExecuteRestApiAsync"? #46

cemerson opened this issue Oct 15, 2021 · 1 comment

Comments

@cemerson
Copy link

cemerson commented Oct 15, 2021

I love the simplicity of SalesforceSharp but does it have anything similar to ForceClient's "ExecuteRestApiAsync" method where you can post to a Salesforce REST custom endpoint? Please point me to example code/wiki notes if either exist already.

By the way I did see this possibly-related thread/pull request but couldn't figure out if that's related or not. Thank you.

@cemerson cemerson changed the title Does SalesforceSharp have something equivalent to ForceClient's "ExecuteRestApiAsync"? Anything equivalent to ForceClient's "ExecuteRestApiAsync"? Oct 15, 2021
@nikomaresco
Copy link

i am using SalesforceSharp to hit a custom REST endpoint. i figured it out based on this issue/PR: #1

in short, you call

SalesforceClient.Create(objectName, recordData, endpointUrl).

as the linked post mentions, your service will either need to respond with something that looks like a standard SFDC REST response, or you will have to parse the response on your own when you encounter a FormatException.

example with my custom endpoint SPS_CreateQueryService living at the endpoint /services/apexrest/SPS_CreateQueryService:

sfdc.Create("SPS_CreateQueryService", myNewRecord, "services/apexrest");

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants