I need connect an application with salesforce. This aplication will send data to the system, and salesforce work with them. In this case, in the third application, user choose products. When user finish, the information of this products (name, price, quantity, ..) are sending to SFDC, and thi products are inserted in the bbdd. I want to do a REST WebService, but I have doubts:
- How is the user authenticated to salesforce? Do you need a token?
- To which URL does the user connect to send the information? I have created a connected app, should I use the url specified in the callback?
Could you please give me an example to solve this?
Thanks.
I have an inicial code:
@RestResource(urlMapping='/products/*')
global without sharing class WB_Products{
@HttpPost
global static boolean createProducts(string nameProd, decimal price, string description) {
boolean toRet = false;
if(name != null && quantity != null && price != null){
Product2 prod = new Product2();
prod.Name = nameProd;
prod.Price__c = price;
prod.Description__c = description;
insert prod;
toRet = true;
}
return toRet;
}
}