Difference between revisions of "Calling REST based Web services"

From Toolsverse Knowledge Base
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
The ETL Framework natively supports REST based Web services. You don't need to do anything special, just make sure sources are linked to the GET endpoints and destinations - to the PUT endpoints.
+
The ETL Framework natively supports REST based Web services. You don't need to do anything special, just make sure your source connection is set to the one linked to the GET endpoint and destinations - to the PUT or POST endpoint.
 +
 
 +
You can use POST, PUT, GET and DELETE HTTP methods. Read more [[how to customize HTTP connection]].  
  
 
Use JSON, XML or text to serialize datasets and objects.
 
Use JSON, XML or text to serialize datasets and objects.
  
You can include access tokens into the endpoint URLs. Example: https://host/rest/v1/data/?filter=123&access_token={access_token}. You will need to set access_token as a system property. Please see examples below:
+
You can customize URL using {token}.
 +
 
 +
For example connection below points to the GET REST endpoint which requires access token:
 +
 
 +
<syntaxhighlight lang="xml">
 +
<connection alias="Some REST endpoint">
 +
  <url>https://host/rest/v1/data/?filter=123&access_token={access_token}</url>
 +
  <connector>com.toolsverse.etl.connector.json.JsonConnector</connector>
 +
  <transport>com.toolsverse.io.HttpProcessor</transport>
 +
</connection>
 +
</syntaxhighlight>
 +
 
 +
You will need to set access_token as a system property. Please see examples below:
  
 
[https://www.toolsverse.com/products/etl-framework/examples/web_services/http_get.shtml Example of the GET request]
 
[https://www.toolsverse.com/products/etl-framework/examples/web_services/http_get.shtml Example of the GET request]
  
[https://www.toolsverse.com/products/etl-framework/examples/web_services/http_put.shtml Example of the PUT request]
+
[https://www.toolsverse.com/products/etl-framework/examples/web_services/http_put.shtml Example of the POST request]

Latest revision as of 00:43, 10 February 2015

The ETL Framework natively supports REST based Web services. You don't need to do anything special, just make sure your source connection is set to the one linked to the GET endpoint and destinations - to the PUT or POST endpoint.

You can use POST, PUT, GET and DELETE HTTP methods. Read more how to customize HTTP connection.

Use JSON, XML or text to serialize datasets and objects.

You can customize URL using {token}.

For example connection below points to the GET REST endpoint which requires access token:

<connection alias="Some REST endpoint">
  <url>https://host/rest/v1/data/?filter=123&access_token={access_token}</url>
  <connector>com.toolsverse.etl.connector.json.JsonConnector</connector>
  <transport>com.toolsverse.io.HttpProcessor</transport>
</connection>

You will need to set access_token as a system property. Please see examples below:

Example of the GET request

Example of the POST request