My Products
Help
Kanyar Mahmoud
PARTNER

500 internal server error - backslash in description

by Kanyar Mahmoud

Hello

 

The problem was noticed while accessing the following URL:  https://integration.visma.net/API/controller/api/v1/dimension/SUBACCOUNT/3
The API returned the following error message: 
{
    "message": "VismaId: 49dda245-6508-47ea-9936-b58f6bb1e86f. Error: An error in processing of field Description value taaaa \\ daaaaaaa This field can only contain plain text."
}
As per the error message, it seems that the description field is rejecting certain characters, specifically backslashes, even though they are properly escaped. This behavior is unexpected and prevents the correct processing of data. 
 
When we remove the // from the description it goes through without a problem. 
 
Here is the JSON:
{
    "dimensionId""SUBACCOUNT",
    "segmentId"3,
    "description": {
        "value""This is to test subsccount update"
    },
    "segmentvalues": [
        {
            "operation""Insert",
            "value""10640",
            "description": {
                "value""testing \\ description"
            },
            "active": {
                "value"true
            }
        }
     
    ]
}
6 REPLIES 6

by Suzdar Ibrahim

Hi Kanyar,

 

It seems like this intended because it neither possible to do it in the UI and API. Is there any reason why you use backslash instead of dash "-" ? 

Kanyar Mahmoud
PARTNER

Hi Suzdar

 

As far as i can see this is possible in the UI:

1.png

Also these subaccounts are created in another system, and is being transferred over to Visma.net through an integration. And the users there use / in the descriptions, but it should be possible to follow the JSON standards of escaping the / and get it in the description. However it is not working in this case. Can you confirm it's a bug?

Accepted solution
Suzdar Ibrahim
VISMA

Hi Kanyar,

 

Aslong as the slashes are not backslashes "\" there should be no issue (the UI aswell). The request below should work and you can also add 2 backslashes and even space between the strings aslong as you don't enter any backslashes.

 

{
"dimensionId": "SUBACCOUNT",
"segmentId": 1,
"description": {
"value": "This is to test subsccount update"
},
"segmentvalues": [
{
"operation": "Insert",
"value": "6",
"description": {
"value": "testing/description"
},
"active": {
"value": false
}
}

]
}

 

 

Screenshot_76.png

Kanyar Mahmoud
PARTNER

I see, my bad. I mixed up the backslash with the / character. You are correct, it is not possible to use backslash in GUI either. Thank you for the help 🙂

 

by Suzdar Ibrahim

Hi Kanyar,

 

Are you trying to create a subaccount or return them? 

Kanyar Mahmoud
PARTNER

Hi Suzdar!


I'm trying to create a subaccount.