Box Mule Connector Integration
This tutorial explains about the Box Connector
functionality in Mule.
Operations performed in this flow:
1.Authorize
2.Get Folder Items Details
3.Unauthorized
Pre-requisites:
1. Anypoint Studio 5.1 with Box plugin
2. Box developer account
3. Jdk 1.7
Create an Application in Box developer site
https://developers.box.com/. Copy the client_secret and client_id
and provide the redirect URI. These details are required for Box
connector configuration.
Box Connector Configuration
Box Mule Flow :
This flow will connect to Box and fetches the folder Items details in
JSON and then Unauthorize.
Source code:
<box:config name="Box" clientId="client_id" clientSecret="clientsecret" doc:name="Box">
<box:oauth-callback-config domain="localhost" localPort="8080" remotePort="8080"
path="boxApi"/>
</box:config>
<flow name="BoxFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/box/authorize"
doc:name="HTTP"/>
<box:authorize config-ref="Box" doc:name="Authorize Box"/>
<logger message="Authorized" level="INFO" doc:name="Logger"/>
<box:get-folder-items config-ref="Box" doc:name="Get Folder details from Box Account"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<box:unauthorize config-ref="Box" accessTokenId="Box" doc:name="Unauthorize Box"/>
</flow>
Source code:
<box:config name="Box" clientId="client_id" clientSecret="clientsecret" doc:name="Box">
<box:oauth-callback-config domain="localhost" localPort="8080" remotePort="8080"
path="boxApi"/>
</box:config>
<flow name="BoxFlow">
<http:listener config-ref="HTTP_Listener_Configuration" path="/box/authorize"
doc:name="HTTP"/>
<box:authorize config-ref="Box" doc:name="Authorize Box"/>
<logger message="Authorized" level="INFO" doc:name="Logger"/>
<box:get-folder-items config-ref="Box" doc:name="Get Folder details from Box Account"/>
<json:object-to-json-transformer doc:name="Object to JSON"/>
<logger message="#[payload]" level="INFO" doc:name="Logger"/>
<box:unauthorize config-ref="Box" accessTokenId="Box" doc:name="Unauthorize Box"/>
</flow>

Box connector Mule ESB Integration

  • 1.
    Box Mule ConnectorIntegration This tutorial explains about the Box Connector functionality in Mule. Operations performed in this flow: 1.Authorize 2.Get Folder Items Details 3.Unauthorized Pre-requisites: 1. Anypoint Studio 5.1 with Box plugin 2. Box developer account 3. Jdk 1.7
  • 2.
    Create an Applicationin Box developer site https://developers.box.com/. Copy the client_secret and client_id and provide the redirect URI. These details are required for Box connector configuration.
  • 3.
  • 5.
    Box Mule Flow: This flow will connect to Box and fetches the folder Items details in JSON and then Unauthorize.
  • 6.
    Source code: <box:config name="Box"clientId="client_id" clientSecret="clientsecret" doc:name="Box"> <box:oauth-callback-config domain="localhost" localPort="8080" remotePort="8080" path="boxApi"/> </box:config> <flow name="BoxFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/box/authorize" doc:name="HTTP"/> <box:authorize config-ref="Box" doc:name="Authorize Box"/> <logger message="Authorized" level="INFO" doc:name="Logger"/> <box:get-folder-items config-ref="Box" doc:name="Get Folder details from Box Account"/> <json:object-to-json-transformer doc:name="Object to JSON"/> <logger message="#[payload]" level="INFO" doc:name="Logger"/> <box:unauthorize config-ref="Box" accessTokenId="Box" doc:name="Unauthorize Box"/> </flow>
  • 7.
    Source code: <box:config name="Box"clientId="client_id" clientSecret="clientsecret" doc:name="Box"> <box:oauth-callback-config domain="localhost" localPort="8080" remotePort="8080" path="boxApi"/> </box:config> <flow name="BoxFlow"> <http:listener config-ref="HTTP_Listener_Configuration" path="/box/authorize" doc:name="HTTP"/> <box:authorize config-ref="Box" doc:name="Authorize Box"/> <logger message="Authorized" level="INFO" doc:name="Logger"/> <box:get-folder-items config-ref="Box" doc:name="Get Folder details from Box Account"/> <json:object-to-json-transformer doc:name="Object to JSON"/> <logger message="#[payload]" level="INFO" doc:name="Logger"/> <box:unauthorize config-ref="Box" accessTokenId="Box" doc:name="Unauthorize Box"/> </flow>