how do I call salesforce APEX From rest api - rest

I find tons of articles explaining how to call rest apis from APEX - but I'm accessing salesforce from an integration system using the Salesforce REST API, and want to it the other way around.
ie -
I've found functionality (record merging) - that is not available from the rest API, but IS available from apex. Is there any way to run an apex statement or script from the rest API?
NOTE: I'm aware that the functionality also available from the SOAP api, but we really don't want to go near that for various reasons.

you want to REST API endpoints in APEX, so that you can call this endpoint from anywhere, Right? if so then you need to check this article.
After reading above article, you are able to create GET, POST, DELETE endpoint in your Salesforce Org and you can use this endpoints.

Related

DocuSign SOAP API for User list

I am trying to get the users associated with DocuSign account using SOAP API.
I tried API GetMembershipSummary(), but is giving an error "Invalid_Login" although X-DocuSign-Authentication is set, and valid email id of admin is provided.
I did noticed that this method is reserved by DocuSign based on this link
The rest API /users is working fine, but I still need equivalent SOAP API.
you are correct. this is one of these things that can only be done using the REST API.
The SOAP API is not currently supported. Meaning, we won't add features or make modifications to it. I highly recommend to use the REST API. If you already have a SOAP Application, you can use the REST API for newer features.

Is there a complete list of sharepoint online rest api from official docs?

As title said, Is there a complete list of sharepoint online rest api from official docs?
I've done some research. However from the MS docs I can only find Complete basic operations using SharePoint REST endpoints and Get to know the SharePoint REST service.
Or maybe there just isn't one for the current Sharepoint Online implementation from official docs which have REST api reference and samples.
I was consider using MS graph as well, however it seems at the moment, the operations exposed by the Graph for SharePoint are very limited when compared to the native SharePoint REST API.
If there is a list, please share.
REST APIs of SharePoint are conformed to the specification of OData, we can use it like we use other OData APIs.
Here you go:
REST API reference and samples
More information about OData, we can refer to: OData - the best way to REST
If you have been authenticated (e.g. have an access token) and you can use the SharePoint API, then you can get a list of available endpoints for GET requests:
https://[tenant].sharepoint.com/[site]/_api/Web
The first part of the response provides a list of endpoints that you can explore further. [site] can be requested at any level (there can be many subsites below).
For example:
https://[tenant].sharepoint.com/[site]/_api/Web/SiteUsers
will allow you to display a list of users on a site and other possible endpoints, and
https://[tenant].sharepoint.com/[site]/[subsite]/_api/Web/Lists
will display all the lists that belong to the given subsite.
Unfortunately, I was not able to get a list of endpoints for POST requests such as: _api/web/lists/getByTitle('Documents')/breakroleinheritance(copyRoleAssignments=false, clearSubscopes=true)

SugarCRM get_entry_list REST API call using REST client or POSTMAN

I am going thru the documentation and examples related to calling REST APIs for SugarCRM using Chrome REST client or PostMan but most of the examples are PHP and I am not finding a good way to find a proper request and other parameters to be mentioned so that I can get the successful response from the API. I was trying get_entry_list. Can someone please help by providing a working REST API request for this API which I can run on REST client or postman?
I also would like to know if I want to build a SugarCRM connector for my application, which set of APIs I should use? Should I go with REST or SOAP and any supporting arguments to choose one over another?
Thanks

REST based Website

I have to create 2 different websites that would use REST api to interact with a single MySQL database.
I know how to create website with forms..etc using PHP.
How would I use REST api for my websites.I searched and found out that there are libraries for android to use REST api but how to do so in case of a website ?
REST is a architectural pattern, it is not (by itself) an API. APIs can implement REST.
Just like any other API out there, you have to get the documentation for the API and then call it from your source.
Depending on what your requirements are, you may be calling it from javascript or from your PHP backend.
REST is an architecture pattern (you can read more about it at wikipedia) which aims to use HTTP verbs like PUT, POST and DELETE to execute commands against endpoints which represent a resource.
To use REST, your backend server will send normal HTTP requests to the API service; so in PHP this means using the various curl libraries to send requests.
Responses are generally in json; but they could be in any other format (or even in binary) - check with the API documentation that you have to consume.
If all you want is interacting with a REST API, then you need a HTTP client, probably cURL (PHP has a cURL lib). After that you have to check whether your API violates the HATEOAS constraint. If not, then it is called hypermedia API. In that case you have to follow hyperlinks provided by the API in the responses. If it violates the constraint, then it is called web API, and you have to build the method, URL, etc... on the client side again, so your client will break easily by any structural changes of the API. Everything else depends on the message format and the semantic annotations the API uses.
If you want to build a REST API, I strongly suggest you to learn more about the topic. First read the Fielding diessertation and check some existing solutions like HAL or Hydra+JSON-LD. Forget the tutorials. Most information available on the web about how to implement a REST API is flawed.

Difference between Apex REST and REST API

Can anyone tell me the difference between the REST API and APEX REST.I am new to REST concept.I am very much confused about them.
The REST API (Force.com REST API) is the generic API provided by Salesforce. On the other hand, the Apex REST API is an API written by yourself in apex to provide custom methods.
The Force.com REST API is great for things such as CRUD operations. You should write a custom Apex REST API when you want to perform more complicated actions.
REST -> architectural style for distributed hypermedia systems.
APREX REST -> Apex REST enables you to implement custom Web services in Apex and expose them through the REST architecture.
Second is used to build RESTful web services
Use the REST API most of the time. You can access your records and update them like you'd expect. But if you need to do something special, like update two records, and only have the changes saved if both updates were successful, then look at Apex REST, where you can customize what your API call does as much as you like.
More details in this interview: https://developer.salesforce.com/blogs/tech-pubs/2011/10/salesforce-apis-what-they-are-when-to-use-them.html