function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Kevin_DMKevin_DM 

Creating an Apex REST API as a proxy around an existing third party API

Hello all,

I was wondering if it was at all possible to use the functionality to build a REST API using APEX and build the API off of an existing third party API. The third party API is also a REST API and is based entirely around email if it makes any difference. The primary reason why I am asking is basically just to know if it is possible and then go from there since most of the information that I am able to find is based around pulling and posting data with Salesforce objects and not building out brand new functionality.
James LoghryJames Loghry
Kevin,

If I'm understanding your ask correctly, you want to bring in a library into Apex.  Unfortunately, you can't bring external libraries like jar files / libraries, etc into Apex.  

You *can* try to write your Apex similar to the third party service, but it'll be different in some capacity, because Apex is different from Java or other languages, in part due to the multi tenant nature of Salesforce, etc.

You could also try to call the third party service from Apex (using your Apex REST service as a proxy of sorts).

Otherwise, you could structure your integration to do most of the the stuff in the existing third party API, but using the Salesforce API to do just Salesforce-y stuffs.