User Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
en:adminmanual:businessmappings:webservicecall [2019/12/16 01:05]
joebordes [Response]
en:adminmanual:businessmappings:webservicecall [2019/12/16 01:08] (current)
joebordes [Examples]
Line 130: Line 130:
 </​code>​ </​code>​
  
-    +An example of Map for REST Call:
- +
- +
  
 +<code XML>
 +<map>
 +<​originmodule>​
 +<​originname>​Accounts</​originname>​
 +</​originmodule>​
 + 
 +<​wsconfig>​
 +<​wsurl>​http://​localhost/​facturascripts/​api/​3/​divisas/​$coddivisa</​wsurl>​
 +<​wshttpmethod>​GET</​wshttpmethod>​
 +<​methodname>​divisas</​methodname>​
 +<​wsresponsetime></​wsresponsetime>​
 +<​wsuser></​wsuser>​
 +<​wspass></​wspass>​
 +<​wsheader>​
 +<​header> ​
 +<​keyname>​Content-type</​keyname> ​
 +<​keyvalue>​application/​json</​keyvalue> ​
 +</​header>​
 +<​header> ​
 +<​keyname>​token</​keyname> ​
 +<​keyvalue>​0WXmP4nVDIGNHKysuceA</​keyvalue> ​
 +</​header>​
 +</​wsheader>​
 +<​wstype>​REST</​wstype>​
 +<​inputtype>​URLRESTFUL</​inputtype>​
 +<​outputtype>​JSON</​outputtype> ​
 +</​wsconfig>​
 + 
 +<​fields>​
 +<​field>​
 +<​fieldname>​coddivisa</​fieldname>​
 +<​Orgfields>​
 +<​Orgfield>​
 +<​OrgfieldName>​tickersymbol</​OrgfieldName>​
 +<​OrgfieldID></​OrgfieldID>​
 +</​Orgfield>​
 +<​delimiter></​delimiter>​
 +</​Orgfields>​
 +</​field>​
 +</​fields>​
 + 
 +<​Response>​
 +<​field>​
 +<​fieldname>​descripcion</​fieldname>​
 +<​destination>​
 +<​field>​ownership</​field>​
 +</​destination>​
 +</​field>​
 +</​Response>​
 +</​map>​
 +</​code>​
  
 +Note how the $coddivisa variable in the URL <​code><​wsurl>​http://​localhost/​facturascripts/​api/​3/​divisas/​$coddivisa</​wsurl></​code>​ will be substituted by the actual value that we have in coreBOS as defined in the fields section. In this case, the value of the tickersymbol field in the Account will be read and $coddivisa will be substituted with that value.