Home > Forum > General > REST API call escaping Base64 forward slashes in JSON payload

REST API call escaping Base64 forward slashes in JSON payload
0

MVP

Hi everyone,

I’m facing a challenge when calling a REST API from WEBCON and I’m hoping someone has encountered something similar.

The API expects the payload in the following format:

{
"InterchangeToken": "NEWABC123",
"SupplierInvoiceCheck": {
"SupplierCode": "string",
"SupplierDocumentNumber": "string",
"SupplierDocumentDate": "2026-05-18T16:22:35.392Z",
"InvoiceEntityType": "PassiveInvoice",
"TotalTaxableAmountToCheck": 0,
"TotalInvoiceAmount": 0,
"ChangeRate": 0,
"TaxableIRPFAmount": 0,
"TotalIRPFAmount": 0,
"IsBlocked": true,
"ReversalDocumentNumber": "string",
"ReversalDocumentDate": "2026-05-18T16:22:35.392Z",
"AccountingRegistrationDate": "2026-05-18T16:22:35.392Z",
"AccountingMovementYear": 0,
"AccountingMovementNumber": 0,
"AccountingMovementID": "string",
"CreatedByUserID": "string",
"AssignmentByUserID": "string",
"BranchCode": "stri",
"CurrencyCode": "EUR",
"IRPFCode": "string",
"PaymentTermCode": "str",
"AccountingReasonCode": "string"
},
"DocumentAttachments": [
{
"DocumentContentExtension": ".PDF",
"DocumentContent": "",
"DocumentDescription": "",
"DocumentNumber": "",
"DocumentDate": "",
"DocumentType": "string"
}
]
}

Everything works fine until I need to send more than one document in DocumentAttachments.

The issue is with DocumentContent, which is expected to be a Base64 string. No matter which approach I try, WEBCON escapes forward slashes (/) into escaped slashes (\/) in the JSON payload, which causes the receiving API to reject the request.

I’ve already tried multiple approaches:

- Direct SQL query
- Business Rule
- Populating a technical field
- Storing attachment data in an item list
- Building the JSON in different ways

In all cases, the same escaping happens.

Has anyone dealt with this before or found a workaround using out-of-the-box WEBCON functionality? Ideally, I’d like to avoid using PowerShell or a custom intermediary service, although PowerShell is still an option if there’s no clean alternative.

Any ideas would be greatly appreciated.

Hi Martin!
Update your body json content into a technical field. In the REST api call action refer the techical field in RAW mode. (right click on field)
We use this method a lot, this is the only workaround I found. It is annoying that you cannot switch off adding escape chars to a business rule result
I hope it help you.
BR
Peter

(Webcon team: please make it possible to to switch off char escaping in BR, or at least to use RAW mode for local variables in automation , as well!)

MVP
In reply to: SIMON Péter

Hi Martin!
Update your body json content into a technical field. In the REST api call action refer the techical field in RAW mode. (right click on field)
We use this method a lot, this is the only workaround I found. It is annoying that you cannot switch off adding escape chars to a business rule result
I hope it help you.
BR
Peter

(Webcon team: please make it possible to to switch off char escaping in BR, or at least to use RAW mode for local variables in automation , as well!)

Hi Peter,

OK, so I’m not crazy after all. 😄 I actually remembered doing exactly this in the past, but this time it simply isn’t working.

I’m currently on version 2026.1.6.209. Not sure if this is related to the latest version or something else, but RAW mode does not seem to help anymore.

Interestingly, I can get the Base64 string without escaped characters if I populate an item list via SQL. However, the moment I populate a multiple lines of text field (technical field), the escape characters (\/) are added again.

That’s why I started wondering whether something changed in recent versions or if I’m missing something obvious.