I'm working with integrations rn, and I'm stuck...
I need to create a public site to receive calls fired by a third-party system. I'm using this tutorial: http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/ .
My classes are described below:
@RestResource(urlMapping='/Lead/*')
Global class ReceivesLead {
global static String NewLead(
String email,
String name,
String mobile_phone,
String Status,
String LeadSource,
String Vehicle__c,
String campaign)
{
Lead ld = new Lead();
ld.LastName = name;
ld.Email = email;
ld.MobilePhone = mobile_phone;
ld.Status = 'xxxx';
ld.LeadSource = 'xxxx';
ld.Vehicle__c = 'xxxx';
ld.IdCampaign__c = campaign;
insert ld;
return 'Done';
And I send the following JSON to test it:
"name":"xxxxxn",
"mobile_phone":"6848446546",
"Status":"example",
"LeadSource":"example",
"Vehicle__c":"example",
"campaign":"example",
}
And I'm receiving the following error from postman:
{
"errorCode": "METHOD_NOT_ALLOWED",
"message": "HTTP Method 'POST' not allowed. Allowed are "
}
]
Thanks in advance!!!