Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Upload images to an API via session tag in the protocol

93 views4 days agodriver files images protocol session
6
Enis Abaza [SLC] [DevOps Advocate]188 4 days ago 0 Comments

I need to upload files using the Session tag within the protocol. The process involves receiving images as Base64-encoded strings, which I then convert into a byte[] format. To attach the files, I use the SetParameterBinary method to set the file parameter.

However, I'm encountering a 500 Internal Server Error in response.

<- 11:01:09 - POST https://.../troubleTicket/2505H25831/attachment
-> 11:01:09 - HTTP/1.1 500 Internal Server Error
-> 11:01:09 - Get for createAttachmentResponseContent (status code: HTTP/1.1 500 Internal Server Error), returned VT_BSTR : {"code":-1,"message":"Internal Server Error","description":"The server encountered an unexpected condition which prevented it from fullfilling the request.","infoURL":"/troubleTicket/2505H25831/attachment"}

Example of a working request in Postman:

Relevant C# code:

private void PrepareAndTriggerCreateAttachmentRequest(AttachmentRequest attachmentRequestBody, string ticketId)
{
SetFileRequestParameter(attachmentRequestBody.File);

SetOtherRequestParameters(attachmentRequestBody, ticketId);
_protocol.CheckTrigger((int)Trigger.FromQActionExecuteCreateAttachmentRequest_31);
}

private void SetFileRequestParameter(byte[] file) => _protocol.SetParameterBinary(Parameter.createattachmentrequestfile_652, file);

private void SetOtherRequestParameters(AttachmentRequest attachmentRequestBody, string ticketId)
{
var parameters = new[]
{
Parameter.createattachmentdynamicurl_1001,
Parameter.createattachmentrequestdescription_653,
Parameter.createattachmentrequestlabel_654,
Parameter.createattachmentrequesttype_655,
};

var values = new object[]
{
$"{TicketBaseUrl}/{ticketId}/attachment",
attachmentRequestBody.Description,
attachmentRequestBody.Label,
attachmentRequestBody.Type,
};

_protocol.SetParameters(parameters, values);
}

Relevant protocol.xml parts:

<Session id="4" name="createAttachment">
<Connection id="1" name="createAttachment">
<Request verb="POST" pid="1001">
<Headers>
<Header key="X-Client-User-Id" pid="104"/>
<Header key="Authorization" pid="105"/>
<Header key="Content-Type">multipart/form-data</Header>
</Headers>
<Parameters>
<Parameter key="file" pid="652" />
<Parameter key="description" pid="653" />
<Parameter key="label" pid="654" />
<Parameter key="type" pid="655" />
</Parameters>
</Request>
<Response statusCode="503">
<Content pid="603"></Content>
</Response>
</Connection>
</Session>

<Param id="652" trending="false">
<Name>createAttachmentRequestFile</Name>
<Description>Create Attachment Request File</Description>
<Type>read</Type>
<Interprete>
<RawType>other</RawType>
<LengthType>next param</LengthType>
</Interprete>
</Param>

I'm seeing different behavior between a request sent via Postman and my own implementation. Since it's HTTPS, I can't directly inspect the raw traffic. Has anyone dealt with this before?

Enis Abaza [SLC] [DevOps Advocate] Asked question 4 days ago

0 Answers

  • Active
  • Voted
  • Newest
  • Oldest
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin