API Connect

API Connect

Join this online 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.


#API Connect
#Applicationintegration
#APIConnect
 View Only
  • 1.  Sending PDF File through REST Request Node in ACE12

    Posted yesterday

    Hi All

    I am trying to send a pdf file through REST Request however the file sent to the destination is broken and invalid. I have the below header values and esql code for MIME. Can some one please let me know what is missing?

    SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/pdf';
    SET OutputRoot.Properties.ContentType = 'multipart/form-data; boundary=' || myBoundary; (myBoundary is UUID value)
    SET OutputRoot.HTTPRequestHeader."Content-Disposition" = 'attachment; filename=' || InputRoot.MQRFH2.usr.fromFile;



    CREATE FIELD OutputRoot.MIME TYPE Name;
    DECLARE M REFERENCE TO OutputRoot.MIME;
    CREATE LASTCHILD OF M TYPE Name NAME 'Parts';
    CREATE LASTCHILD OF M.Parts TYPE Name NAME 'Part';
    DECLARE P1 REFERENCE TO M.Parts.Part[1];
    CREATE FIELD P1."Content-Disposition" TYPE NameValue VALUE 'form-data; name="attachment"; filename=' || InputRoot.MQRFH2.usr.fromFile;
    CREATE FIELD P1."Content-Type" TYPE NameValue VALUE 'application/pdf';
    CREATE FIELD P1."Content-Id"   TYPE NameValue VALUE 'p1';
    CREATE LASTCHILD OF P1 TYPE Name NAME 'Data';
    CREATE LASTCHILD OF P1.Data DOMAIN('BLOB') VALUE InputRoot.BLOB.BLOB;

    The swagger file has below for the request body

    "requestBody": {
              "content": {
                "application/pdf": {
                  "schema": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              }
            }


    ------------------------------
    Naveena Velusamy
    ------------------------------


  • 2.  RE: Sending PDF File through REST Request Node in ACE12

    Posted 5 hours ago

    I think you might have more luck asking ACE questions in the AppConnect community rather than the APIConnect one? :-)



    ------------------------------
    Chris Dudley
    ------------------------------