- Joined
- Oct 20, 2021
- Messages
- 8
- Reaction score
- 0
Hi,
Could you please explain what's wrong with Create Contact Record request?
We get the following error on Test:
Template:
When we do a POST request in Postman sending {"phoneNumber":"12345678","firstName":"New","lastName":"3CX Contact 12345678"} as JSON to https://crm.espocrm.com/api/v1/Contact, the CRM successfully creates a new account.
Could you please explain what's wrong with Create Contact Record request?
We get the following error on Test:
XML:
Request text: https://crm.espocrm.com/api/v1/Contact
Request message: {"phoneNumber":"12345678","firstName":"New","lastName":"3CX Contact 12345678"}
System.Exception: Server returned a non successful status code - HTTPStatusCode=BadRequest - Reason=Bad Request - Content=
at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.CrmProcessor.CreateContactRecord(IValueManager customManager, String scenarioId, Func`2 filterResultsFunctor, CancellationToken token)
Template:
XML:
<Scenario Id="CreateContactRecord" Type="REST">
<Request SkipIf="[CreateContactEnabled]!=True||[IIf([CreateOnCallDirection]==Inbound,[CallDirection]!=Inbound,False)]==True" Url="https://crm.espocrm.com/api/v1/Contact" MessagePasses="0" RequestContentType="application/json" RequestEncoding="Json" RequestType="Post" ResponseType="Json">
<PostValues Key="">
<Value Key="phoneNumber" Passes="1" Type="String">[Number]</Value>
<Value Key="firstName" Passes="2" Type="String">[CreateContactFirstName]</Value>
<Value Key="lastName" Passes="2" Type="String">[CreateContactLastName]</Value>
</PostValues>
</Request>
<Rules>
<Rule Type="Any">id</Rule>
</Rules>
<Variables>
<Variable Name="ContactID" Path="id">
<Filter />
</Variable>
<Variable Name="FirstName" Path="firstName">
<Filter />
</Variable>
<Variable Name="LastName" Path="lastName">
<Filter />
</Variable>
<Variable Name="CompanyName" Path="accountName">
<Filter />
</Variable>
<Variable Name="Email" Path="emailAddress">
<Filter />
</Variable>
<Variable Name="PhoneBusiness" Path="phoneNumber">
<Filter />
</Variable>
</Variables>
<Outputs AllowEmpty="false">
<Output Type="ContactID" Passes="0" Value="[ContactID]" />
<Output Type="FirstName" Passes="0" Value="[FirstName]" />
<Output Type="LastName" Passes="0" Value="[LastName]" />
<Output Type="CompanyName" Passes="0" Value="[CompanyName]" />
<Output Type="Email" Passes="0" Value="[Email]" />
<Output Type="PhoneBusiness" Passes="0" Value="[PhoneBusiness]" />
<Output Type="ContactUrl" Passes="0" Value="https://crm.espocrm.com/#Contact/view/[ContactID]" />
<Output Type="EntityId" Passes="0" Value="[ContactID]" />
<Output Type="EntityType" Passes="0" Value="Contacts" />
</Outputs>
</Scenario>
When we do a POST request in Postman sending {"phoneNumber":"12345678","firstName":"New","lastName":"3CX Contact 12345678"} as JSON to https://crm.espocrm.com/api/v1/Contact, the CRM successfully creates a new account.