App Connect

App Connect

Join this online user group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#Applicationintegration
#App Connect
#AppConnect
#Integration
#Automation
 View Only
  • 1.  Dropbox create file example

    Posted 05/20/24 07:31 PM

    Hi,

    I've been trying to write a file to Dropbox using the Dropbox request node.

    Does anyone have an example of this?

    The documentation page mentions examples are available once App Connect is connected to Dropbox which I have done.  I don't know how to access the examples.  There are no examples for Dropbox in the Tutorial gallery.

    How to use IBM App Connect with Dropbox

    This is what I have tried.

    Specify in the message where the file contents are

    Here is the error from the Dropbox request node failure trace

    ========== Trace Generated at 2024-05-20 17:56:29.034588 ==========
    ( ['WSRoot' : 0x243c7ab6e40]
      (0x01000000:Name):Properties      = ( ['WSPROPERTYPARSER' : 0x244c9356690]
        (0x03000000:NameValue):MessageSet             = '' (CHARACTER)
        (0x03000000:NameValue):MessageType            = '' (CHARACTER)
        (0x03000000:NameValue):MessageFormat          = '' (CHARACTER)
        (0x03000000:NameValue):Encoding               = 546 (INTEGER)
        (0x03000000:NameValue):CodedCharSetId         = 1208 (INTEGER)
        (0x03000000:NameValue):Transactional          = FALSE (BOOLEAN)
        (0x03000000:NameValue):Persistence            = FALSE (BOOLEAN)
        (0x03000000:NameValue):CreationTime           = GMTTIMESTAMP '2024-05-20 22:56:28.504' (GMTTIMESTAMP)
        (0x03000000:NameValue):ExpirationTime         = -1 (INTEGER)
        (0x03000000:NameValue):Priority               = 0 (INTEGER)
        (0x03000000:NameValue):ReplyIdentifier        = X'000000000000000000000000000000000000000000000000' (BLOB)
        (0x03000000:NameValue):ReplyProtocol          = 'SOAP-HTTP' (CHARACTER)
        (0x03000000:NameValue):Topic                  = NULL
        (0x03000000:NameValue):ContentType            = 'text/plain; charset=utf-8' (CHARACTER)
        (0x03000000:NameValue):IdentitySourceType     = '' (CHARACTER)
        (0x03000000:NameValue):IdentitySourceToken    = '' (CHARACTER)
        (0x03000000:NameValue):IdentitySourcePassword = '' (CHARACTER)
        (0x03000000:NameValue):IdentitySourceIssuedBy = '' (CHARACTER)
        (0x03000000:NameValue):IdentityMappedType     = '' (CHARACTER)
        (0x03000000:NameValue):IdentityMappedToken    = '' (CHARACTER)
        (0x03000000:NameValue):IdentityMappedPassword = '' (CHARACTER)
        (0x03000000:NameValue):IdentityMappedIssuedBy = '' (CHARACTER)
      )
      (0x01000000:Name):HTTPInputHeader = ( ['WSINPHDR' : 0x243c7ab81c0]
        (0x03000000:NameValue):Content-Type            = 'text/plain; charset=utf-8' (CHARACTER)
        (0x03000000:NameValue):Cache-Control           = 'no-cache' (CHARACTER)
        (0x03000000:NameValue):Pragma                  = 'no-cache' (CHARACTER)
        (0x03000000:NameValue):User-Agent              = 'Java/11.0.22' (CHARACTER)
        (0x03000000:NameValue):Host                    = 'localhost:7800' (CHARACTER)
        (0x03000000:NameValue):Accept                  = 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2' (CHARACTER)
        (0x03000000:NameValue):Connection              = 'keep-alive' (CHARACTER)
        (0x03000000:NameValue):Content-Length          = '7284' (CHARACTER)
        (0x03000000:NameValue):X-Original-HTTP-Command = 'POST http://localhost:7800/REST/getUser HTTP/1.1' (CHARACTER)
        (0x03000000:NameValue):X-Server-Name           = 'localhost' (CHARACTER)
        (0x03000000:NameValue):X-Server-Port           = '7800' (CHARACTER)
        (0x03000000:NameValue):X-Remote-Addr           = '127.0.0.1' (CHARACTER)
        (0x03000000:NameValue):X-Remote-Host           = 'localhost' (CHARACTER)
        (0x03000000:NameValue):X-Scheme                = 'http' (CHARACTER)
      )
      (0x01000000:Name):MIME            = ( ['MIME' : 0x243c7af7560]
        (0x03000000:NameValue):Content-Type = 'text/plain; charset=utf-8' (CHARACTER)
        (0x01000000:Name     ):Data         = (
          (0x01000000:Name):BLOB = ( ['none' : 0x244c8f4e6a0]
            (0x03000000:NameValue):BLOB = X'4e414d45202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020484f53542f504f525420202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020504154482020202020202020202020202020202020202020202020202020202020202053455256494345532020202020202020202020202020202020202020202020202020504f5254202020202020205445524d494e4154494f4e202020202057494c44434152440d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652020202020202020202020202020202020202020202020202020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d62326261706920202020202020202020202020202020202020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f423242415049732f7376632020202020202020202020202020202020202020202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d623262697669736962696c6974792020202020202020202020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f623262697669736962696c6974792f737761676765722d75692e68746d6c20202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d62706161732020202020202020202020202020202020202020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f62706161732f76312020202020202020202020202020202020202020202020202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d637573746f6d697a6174696f6e202020202020202020202020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f70726f706572747955492f6170702020202020202020202020202020202020202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d737761676765722d637573746f6d6f72646572617069732020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f637573746f6d6f72646572617069732f737761676765722d75692e68746d6c202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d737761676765722d6562696373636c69656e74617069732020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f6562696373636c69656e74617069732f737761676765722d75692e68746d6c202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d737761676765722d6562696373736572766572617069732020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f6562696373736572766572617069732f737761676765722d75692e68746d6c202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d737761676765722d7067706170697320202020202020202020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f706770617069732f737761676765722d75692e68746d6c2020202020202020202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d737761676765722d7366676170697320202020202020202020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f736667617069732f737761676765722d75692e68746d6c2020202020202020202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6170692d696e7465726e616c2d726f7574652d737761676765722d7377696674617069732020202020202020206170692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f7377696674617069732f737761676765722d75692e68746d6c202020202020202020623262692d623262692d6170692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652020202020202020202020202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d64617368626f61726420202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f64617368626f61726420202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d6562696373636c69656e742020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f6562696373436c69656e742020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d66696c65676174657761792020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f66696c65676174657761792020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d6d61696c626f78202020202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f6d61696c626f78202020202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d6d796667202020202020202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f6d796667202020202020202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d6d7966696c6567617465776179202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f6d7966696c6567617465776179202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d71756575657761746368202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f71756575655761746368202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d73766320202020202020206874747020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d736f6170202020202020202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f736f6170202020202020202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d7376632020202020202020736f612020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d736f61702d6e65772020202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f736f61702d6e65772020202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d7376632020202020202020736f612020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d736f61702d73796e6320202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f736f61702d73796e6320202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d7376632020202020202020736f612020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d736f61702d73796e632d6e6577202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f736f61702d73796e632d6e6577202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d7376632020202020202020736f612020202020202020202020202020202020202020202020204e6f6e650d0a623262692d623262692d6173692d696e7465726e616c2d726f7574652d7773646c202020202020202020202020202020202020202020206173692e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f7564202020202020202020202020202020202020202020202f7773646c202020202020202020202020202020202020202020202020202020202020623262692d623262692d6173692d66726f6e74656e642d7376632020202020202020736f612020202020202020202020202020202020202020202020204e6f6e650d0a6974782d72732d726f757465202020202020202020202020202020202020202020202020202020202020202020202020202020202020206974782d72732d726f7574652d623262692d697478612e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f756420202020202020202020202020202020202020202020202020202020202020202020202020206974782d72732d7376632020202020202020202020202020202020202020202020207463702d68747470202020202020202020202020202020202020204e6f6e650d0a697478612d69626d2d697478612d70726f642d69747861696e67726573732d34736a6a6720202020202020202020202020202020202020697478612e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f75642020202020202020202020202020202020202020202f7370652f202020202020202020202020202020202020202020202020202020202020697478612d69626d2d697478612d70726f642d6974786175697365727665722020206874747020202020202020656467652f52656469726563742020204e6f6e650d0a697478612d69626d2d697478612d70726f642d69747861696e67726573732d74717a6c6c20202020202020202020202020202020202020697478612e7364652d66306134663963323234336139376361353463313934373866643539366338662d303030302e75732d736f7574682e636f6e7461696e6572732e617070646f6d61696e2e636c6f75642020202020202020202020202020202020202020202f61646d696e43656e7465722f20202020202020202020202020202020202020202020697478612d69626d2d697478612d70726f642d6974786175697365727665722020206874747020202020202020656467652f52656469726563742020204e6f6e650d0a' (BLOB)
          )
        )
      )
    )
    ( ['MQROOT' : 0x243c7ab7180]
      (0x01000000:Name):Destination        = (
        (0x01000000:Name):HTTP = (
          (0x03000000:NameValue):RequestIdentifier = X'455648540000000000000000577738988c32000000000000' (BLOB)
        )
      )
      (0x01000000:Name):WrittenDestination = (
        (0x01000000:Name):File = (
          (0x03000000:NameValue):Directory = 'C:\temp' (CHARACTER)
          (0x03000000:NameValue):Name      = 'out.txt' (CHARACTER)
          (0x03000000:NameValue):Action    = 'Replace' (CHARACTER)
          (0x03000000:NameValue):Timestamp = '20240520_225629_019734' (CHARACTER)
        )
      )
    )
    ( ['MQROOT' : 0x243c7ab5100]
      (0x01000000:Name):RecoverableException = (
        (0x03000000:NameValue):File                 = 'C:\ci\product-build\WMB\src\DataFlowEngine\MessageServices\ImbDataFlowNode.cpp' (CHARACTER)
        (0x03000000:NameValue):Line                 = 1867 (INTEGER)
        (0x03000000:NameValue):Function             = 'ImbDataFlowNode::createExceptionList' (CHARACTER)
        (0x03000000:NameValue):Type                 = 'ComIbmApplicationConnectorRequest' (CHARACTER)
        (0x03000000:NameValue):Name                 = 'ExampleSlackFlow#FCMComposite_1_15' (CHARACTER)
        (0x03000000:NameValue):Label                = 'ExampleSlackFlow.Create File' (CHARACTER)
        (0x03000000:NameValue):Catalog              = 'BIPmsgs' (CHARACTER)
        (0x03000000:NameValue):Severity             = 3 (INTEGER)
        (0x03000000:NameValue):Number               = 2230 (INTEGER)
        (0x03000000:NameValue):Text                 = 'Node throwing exception' (CHARACTER)
        (0x01000000:Name     ):Insert               = (
          (0x03000000:NameValue):Type = 14 (INTEGER)
          (0x03000000:NameValue):Text = 'ExampleSlackFlow.Create File' (CHARACTER)
        )
        (0x01000000:Name     ):RecoverableException = (
          (0x03000000:NameValue):File     = 'C:\ci\product-build\WMB\src\DataFlowEngine\nodejs\NodejsManager\ImbNodejsTreeConversions.cpp' (CHARACTER)
          (0x03000000:NameValue):Line     = 1274 (INTEGER)
          (0x03000000:NameValue):Function = 'ImbNodejsTreeConversions::fromTree' (CHARACTER)
          (0x03000000:NameValue):Type     = '' (CHARACTER)
          (0x03000000:NameValue):Name     = '' (CHARACTER)
          (0x03000000:NameValue):Label    = '' (CHARACTER)
          (0x03000000:NameValue):Catalog  = 'BIPmsgs' (CHARACTER)
          (0x03000000:NameValue):Severity = 3 (INTEGER)
          (0x03000000:NameValue):Number   = 4758 (INTEGER)
          (0x03000000:NameValue):Text     = 'Message tree not owned by required parser type' (CHARACTER)
          (0x01000000:Name     ):Insert   = (
            (0x03000000:NameValue):Type = 5 (INTEGER)
            (0x03000000:NameValue):Text = '$InputRoot/MIME/Data/BLOB/BLOB' (CHARACTER)
          )
          (0x01000000:Name     ):Insert   = (
            (0x03000000:NameValue):Type = 5 (INTEGER)
            (0x03000000:NameValue):Text = 'BLOB' (CHARACTER)
          )
          (0x01000000:Name     ):Insert   = (
            (0x03000000:NameValue):Type = 5 (INTEGER)
            (0x03000000:NameValue):Text = 'JSON' (CHARACTER)
          )
        )
      )



    ------------------------------
    Mike Lamb
    Product Manager
    IBM
    Austin TX
    ------------------------------


  • 2.  RE: Dropbox create file example

    Posted 05/20/24 07:33 PM
      |   view attached

    Attached are the message in and out of the Dropbox request node



    ------------------------------
    Mike Lamb
    Product Manager
    IBM
    Austin TX
    ------------------------------

    Attachment(s)



  • 3.  RE: Dropbox create file example

    Posted 05/21/24 08:21 AM

    Hi Mike,

    The core problem you are facing is that the Dropbox Request node expects to receive a JSON structure from the message flow node which precedes it in your flow. When you go through the discovery process, the Dropbox Request node returns to the flow developer a JSON schema that describes what this structure looks like.  This file is saved into your application project ... its name is a concatenation of the name of your message flow and the name of the Dropbox node and the last sections tell you if the schema is for the request or the response (returned back to the flow developer for use in downstream nodes. In my case I created a flow called "DropboxExample" and my Dropbox Request node is called "Dropbox Request" and I have the following JSON schemas in my project:

    DropboxExample.Dropbox_Request.request.schema.json

    DropboxExample.Dropbox_Request.response.schema.json

    When you go through the discovery process, you will see a section near the top of the discovery dialog (after you have connected to Dropbox) which is called "Controls". There is a little twistie to expand and contract the section which will reveal an enumerated dropdown which can be set to either "Use input message unchanged" or "Define mappings below".

    For your usecase, you appear to have data coming in to Dropbox which is not defined in a JSON schema ... so defining a mapping in JSONata as part of the discovery process is not an option for you. If you *did* have a JSON schema, then you could use that on the Map Inputs table property on the node ... I can see you tried to do this in one of your screen shots but this won't work because the data being passed into the Dropbox Request node is not in the JSON domain. Sooo ... given your situation, you should select the options in "Controls" to be "Use input message unchanged" and then we can deal with the mapping part of the puzzle in your message flow before reaching the Dropbox Request node. 

    There are several ways in which you can take binary data from an input node and map it into a JSON domain message ready for the DropboxRequest node. I have created a simple example which uses a FileInput node with the BLOB domain to read in the file, and then a graphical map node to convert the BLOB message into a JSON message ready for the Dropbox Request node. I used the JSON schema mentioned at the top of this post to model the target of the graphical map, and I selected the BLOB domain for the source of the graphical map.  My map looks like this:

    As you can see there are a handful of fields to control what Dropbox should do ... the "Assign" mappings are telling Dropbox where to write the file ... so for "path" I added an Assign of the value "ACE_BenThompson" because this is the name of the folder I have set up in my instance of Dropbox.  For the "name" field I assigned the value of "myfilename.txt" which is the name of the file I'm writing in to the Dropbox folder. For the "fileType" field I assigned the value of "Text" (I think the other valid option is "Binary" but I didn't figure out how to pass in binary values directly as part of my quick playing around). For the "fileContent" I wanted to cast the BLOB (hexBinary) data coming in as a text string ... Graphical maps use XSLT or XPath functions to help out with mappings and I couldnt find a handy built in function, so I stole a little snippet of code which I've used in the past (I actually took this from one of the other tutorials in ACE Toolkit titled "File - Using the FileInput node with Delimited record detection") .. I used this with the "Custom XPath" mapping option:
    codepoints-to-string(
       for $index  in (1 to string-length(string($value)))[. mod 2 = 1],
           $hinibble in (substring(string($value), $index, 1)),
           $lonibble in (substring(string($value), $index + 1, 1))
       return
           (16 * string-length(substring-before('0123456789ABCDEF', upper-case($hinibble)))) +
           string-length(substring-before('0123456789ABCDEF', upper-case($lonibble))))
    Pulling it all together, I was able to get your scenario to work as shown in the screenshots below ... I can provide the example project interchange and flow if you'd like a copy. 


    ------------------------------
    Ben Thompson
    IBM UK
    ------------------------------



  • 4.  RE: Dropbox create file example

    Posted 05/21/24 08:32 AM

    Thanks Ben for the detailed explanation.

    Please provide the interchange project and example flow. Its hard to read the screenshots.

    Thanks



    ------------------------------
    Mike Lamb
    Product Manager
    IBM
    Austin TX
    ------------------------------



  • 5.  RE: Dropbox create file example

    Posted 05/21/24 08:46 AM
      |   view attached

    I'm attaching the Project Interchange file to this post, which has the Application project and Policy project. I've not included my vault / dropbox credential for obvious reasons :) If you want to see bigger versions of the pictures embedded in posts in the community then you should be able to double click them and the browser will show them in front of the thread with an increased size.  Cheers, Ben



    ------------------------------
    Ben Thompson
    IBM UK
    ------------------------------

    Attachment(s)

    zip
    PI_DropboxExample.zip   5 KB 1 version