Heroku - 22 API REST Introduction

Hello everyone and welcome to this introductory course to heroku, let's talk today about the integration native integration of the apei remains of this force the goal is I remind it again to synchronize data between salesforce heroku, so how does it work salesforce uses an architecture where each object is an independent table each table has fields that you can use to store information and manipulate them to fit your business logic business logic this suffering allows you to manipulate all these tables via calls or queries from the peace y remains in other words table keys can be accessed and manipulated viala country remains this api can then be accessed through external applications like for example a heroku application, by default with the country you can create new entries for the tables update any field could read data from the tables as well as delete columns from the tables it works like a normal restful api let's see an example to understand how it works let's consider that we have a landing page a landing page so the goal of this landing page is that the person falling on this page sign up for a newsletter by filling in their email address let's say you use salesforce to manage all the emails and to send them promotions of secondary products etc in order to start your emails you will first have to send them to salesforce so that they can be used later on what we can do here is create the landing page and post it in heroku, now when a person enters airs in scene his email a request to country and makes to salesforce they have appetite to create a new entry in a table with the email provided in this simple example could see how it is possible to create information within salesforce let's take a closer look at how the country these Helen Paint that must be called in order to be able to perform any action on the any action on the object to 40 let us take things step by step to better understand first in the tip it is the instance basically it's the url you provide force when you register on the platform suite services data and the version tells salesforce that we are interested in manipulating the data more simply the request sent is related to an action on data finally the last two parts s object and to 40 indicates to which object we if you want to access another object you will have to change the last two parts of the tip instead of manipulating this request by yourself it is recommended to find an external library that can do it this freedom can simplify and make faster the process to make the integration for example as we will see in the practical part with notes you have js force which is a library with methods already integrated and developed so you can interact easily and without risk with the rest api of salesforce if you don't use note don't panic there are libraries libraries for almost all other languages that are supported by heroku, for example salesforce simpl for python and this force pull datacom api pull to build and clients for java there are two limitations you need to consider when choosing the consider when choosing the rest of this source the first is that there is a limit to your requests they can weigh a maximum of 3 megs that means that no matter what you do in terms of insertion or update your query can't exceed 3 megs you also can't interact with more than 2000 rows park is the second limit is that salesforce limits the number of api calls it receives per day so for example depending on your account type salesforce you have a limit on the number of calls you are allowed per day so before you make the decision to use the decision to use the rest country it is advisable to estimate how many requests you expect to have per day and validate the fact that you have a margin left in terms of the maximum number of requests in conclusion the requests of the country queries are a practical solution to manage data on salesforce by nature these country queries remain are a bit slower than using for example and neck connect the reason for this is that when you make a request via the native api you will need years of browser clients to the heroku application, which would make a request to salesforce the country remainder should be avoided for what is to give very changeable for for example if the data you send by the foot of the worst is going to change several times a day there country remains is not necessarily to be considered because due to this there will be a large number of requests which to affect the speed and the performances of an application on the other hand if your data are for for example configuration data that does not change often or simply data that is not modified several times a day there rest country is the recommended option because you will have you data synchronized between salesforce heroku, in real time apei rest is a great tool to have in general to used salesforce because it can help you to a claude large amounts of data to salesforce or retrieve some at a significantly lower cost. recover at a significantly lower cost than for example heroku connect. That's it for this video but I'll see you soon for the see you soon for the next one !