Differences

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

appendixd:appendixd [2019/02/11 08:18]
bdjordje
appendixd:appendixd [2019/06/04 06:44] (current)
dperic [API EXAMPLE]
Line 32: Line 32:
   * [[appendixd:setcartpropertiesforeveryquoteinopportunitywebmethod:setcartpropertiesforeveryquoteinopportunitywebmethod|]]   * [[appendixd:setcartpropertiesforeveryquoteinopportunitywebmethod:setcartpropertiesforeveryquoteinopportunitywebmethod|]]
   * [[appendixd:pricingapi:pricingapi|]]   * [[appendixd:pricingapi:pricingapi|]]
-  * [[appendixd:simple_product_administration:simple_product_administration|]]+  * [[appendixd:simple_product_administration:input_and_output_parameters|Simple Product Administration]] 
 +  * [[appendixd:importmaterialsfromerp_soap_api|ImportMaterialsFromERP SOAP API]]
 </WRAP> </WRAP>
 </WRAP> </WRAP>
  
 SAP CPQ API allows external applications to call SAP CPQ API allows external applications to call
-appropriate methods in SAP CPQ. This helps automation of processes and+appropriate methods in SAP CPQ. This helps the automation of processes and
 eliminates the need to manually enter information. eliminates the need to manually enter information.
-For example if company uses a separate application to process shipping+For exampleif company uses a separate application to process shipping
 information after an order has been placed, SAP CPQ API can be used to information after an order has been placed, SAP CPQ API can be used to
-update a quote with shipping information, such as tracking number, +update a quote with shipping information, such as tracking number, 
-tracking URL, estimated shipping date, etc+tracking URL, estimated shipping date, and so on.
  
 SAP CPQ API supports quote updates, quote actions execution , customer creation and updates, SAP CPQ API supports quote updates, quote actions execution , customer creation and updates,
 user updates etc. user updates etc.
 \\ \\
-<note> +== SOAP API Limitations == 
-You can import or export up to 20MB of data via API in a single call. +  * You can import or export up to 20MB of data via the API in a single call. 
-</note> +  * The execution timeout of all HTTP requests is 20 minutes.
 \\ \\
 Currently, several web services are offered: Currently, several web services are offered:
Line 71: Line 72:
  
 To access SAP CPQ’s API, use the following URLs:  To access SAP CPQ’s API, use the following URLs: 
-  * <application root>/wsAPI/CPQAPI.asmx - this is the set of user level functions +  * <application root>/wsAPI/CPQAPI.asmx - this is the set of user-level functions 
-  * <application root>/wsAPI/wssrv.asmx - this is the set of admin level functions+  * <application root>/wsAPI/wssrv.asmx - this is the set of administrator-level functions
 For example, to access the functions on the For example, to access the functions on the
 www.webcomcpq.com installation, the following URLs would be used: www.webcomcpq.com installation, the following URLs would be used:
 www.webcomcpq.com/wsAPI/CPQAPI.asmx and www.webcomcpq.com/wsAPI/wssrv.asmx.  To view the list of functions that www.webcomcpq.com/wsAPI/CPQAPI.asmx and www.webcomcpq.com/wsAPI/wssrv.asmx.  To view the list of functions that
-an API URL contains, enter the URL into any Web browser. Click an function to view the parameters that the function takes.+an API URL contains, enter the URL into any Web browser. Click function to view the parameters that the function takes.
 \\  \\ 
  
Line 88: Line 89:
 used. used.
 <note>Inactive users will not be able to perform any API calls, since <note>Inactive users will not be able to perform any API calls, since
-their login data is checked, just as in the standard web based SAP CPQ+their login data is checked, just as in the standard web-based SAP CPQ
 application. Don't forget that all API calls are case-sensitive.</note> application. Don't forget that all API calls are case-sensitive.</note>
 SAP CPQ workflow is applied to this user when performing an API function.  In SAP CPQ workflow is applied to this user when performing an API function.  In
Line 102: Line 103:
  
 The **ERPOrderID** is an external system’s (ERP) order number that has The **ERPOrderID** is an external system’s (ERP) order number that has
-been assigned to the SAP CPQ OrderID.  It is not required b ut is available+been assigned to the SAP CPQ OrderID.  It is not required but is available
 if necessary. if necessary.
 \\  \\ 
Line 109: Line 110:
 performed. The XML includes two elements to describe the  action: performed. The XML includes two elements to describe the  action:
 ActionName and ActionParameters.  ActionName is the name of the action ActionName and ActionParameters.  ActionName is the name of the action
-that will be per formed on the cart/quote.  ActionParameters is any +that will be performed on the cart/quote.  ActionParameters is any 
-parameters t he action needs.  For this example, CHANGESTATUS is the +parameters the action needs.  For this example, CHANGESTATUS is the 
-ActionName and the new status is the ActionParameters .+ActionName and the new status is the ActionParameters.
 \\  \\ 
  
Line 120: Line 121:
 \\  \\ 
  
-More than one action may be included  in the XML as long as it stays+More than one action may be included in the XML as long as it stays
 within the Action tag and includes the same elements. within the Action tag and includes the same elements.
 \\  \\ 
Line 131: Line 132:
 quote to will be included within a STATUS tag. quote to will be included within a STATUS tag.
 \\  \\ 
 +
 +==== Invalid XML Characters ====
 +
 +If any of the special characters from the table below are used in an XML document, loading the document results in an //Invalid XML// error. The table lists the invalid characters, as well as what they should be replaced with in the XML. Furthermore, issues could be caused by badly formatted tags, such as ''<b>'' instead of ''<b/>''.
 +
 +^ Invalid XML Characters      ^ Replace with       ^
 +| "<"    | "&amp;lt;"     |
 +| ">"    | "&amp;gt;" |
 +| "\""   | "&amp;quot;"   |
 +| "\'"   | "&amp;apos;"   |
 +| "&"    | "&amp;amp;"    |
  
 <note> <note>
 To review an example code that uses the SAP CPQ API click {{:appendixd:userapisample.zip|here}} To review an example code that uses the SAP CPQ API click {{:appendixd:userapisample.zip|here}}
 </note> </note>
 +
 +===== OAuth 2.0 Authentication ====
 +
 +In order to access any part of SAP CPQ **Setup** via REST API, you need to be logged in. Logging in requires a bearer token, which can be retrieved by providing an adequate username, password, and domain. \\
 +{{:appendixd:dobijanje_tokena.png?650}}\\
 +Once you do this, you will recieve a bearer token with which you can access certain parts of **Setup**. This type of authentication is only used for endpoints which consist of **url../setupSpa/**.
 +<note> Each following API call can be performed with the same token, so you are not required to request a new one per each request. </note>
  
 ===== XWS (EXTERNAL WEB SERVICE) ===== ===== XWS (EXTERNAL WEB SERVICE) =====
    
-**XWS** is SAP CPQ tag that allows+**XWS** is an SAP CPQ tag that allows
 external services to be called.  It also allows for external, noncurrent, external services to be called.  It also allows for external, noncurrent,
 product data to be evaluated and used inside expressions.  This tag product data to be evaluated and used inside expressions.  This tag
Line 145: Line 164:
 \\  \\ 
  
-Syntax for the XWS tag is <***XWS(Fun ctionName, FunctionParameters)***>.+Syntax for the XWS tag is <***XWS(FunctionName, FunctionParameters)***>.
 For example **<***XWS(GETPRODUCTPRICE, Product Name)***> **or For example **<***XWS(GETPRODUCTPRICE, Product Name)***> **or
 **<***XWS(GETPRODUCTCATCODE, Product Name)***> **or **<***XWS(GETPRODUCTCATCODE, Product Name)***> **or
Line 151: Line 170:
 price, product part number or product description for a referenced price, product part number or product description for a referenced
 product.  For more information on referenced products and product’s product.  For more information on referenced products and product’s
-hierarchy, see the chapter on Produc t’s Hierarchy.+hierarchy, see the chapter on Product’s Hierarchy.
 \\  \\ 
  
Line 160: Line 179:
 <condition_column_1_name>,  <condition_value_1>, <condi <condition_column_1_name>,  <condition_value_1>, <condi
 tion_column_2_name>, <condition_value_2>...) ***>**. tion_column_2_name>, <condition_value_2>...) ***>**.
-To avoid using HTTP post with an XWS call, the AUX tag can be used+To avoid using an HTTP post with an XWS call, the AUX tag can be used
 instead to access uploaded table data. Using this tag instead ensures a instead to access uploaded table data. Using this tag instead ensures a
 faster result. The syntax is the same as XWS call except the AUX TABLE is faster result. The syntax is the same as XWS call except the AUX TABLE is
Line 168: Line 187:
 For example, the following expression  would be used to return a value For example, the following expression  would be used to return a value
 from the field CONTRACT_PRICE in the table called CONTRACTS, where part from the field CONTRACT_PRICE in the table called CONTRACTS, where part
-number in the PartNumber field is equal to the config ured part number of+number in the PartNumber field is equal to the configured part number of
 the product: the product:
 **<***AUX(AUXTABLE,CONTRACTS,C ONTRACT_PRICE,PartNumber,<*** ProductCode **<***AUX(AUXTABLE,CONTRACTS,C ONTRACT_PRICE,PartNumber,<*** ProductCode
 ***>)***>** ***>)***>**
You are here: SAP Sales Cloud CPQ Online HelpSAP CPQ API