I'm making a Custom API Call in Fusion and I'm trying to update a parameter value that has a question mark in the name.
Does anyone know how to make this work. I've tried a unicode value an encoded Url value a backslash??
Can anyone help?
Thank you.
Views
Replies
Total Likes
Hi @RobertDy
If you are using JAVA to make an API call, try to use the below code snippet that might help.
String value = docMetadata.has(MetadataConstants.JCR_TITLE)
? docMetadata.get(MetadataConstants.JCR_DESCRIPTION).getAsString().replace("?", "%3F")
: StringUtils.EMPTY;
In Place of title or description use the parameters that you are passing.
Views
Replies
Total Likes
Thank you for your reply. I'm actually using Fusion (I updated my question).
However, I think I tried replacing the question mark with %3F and it didn't seem to work.
Rob
Views
Replies
Total Likes
To make sure I understand, you are trying to update one of a parameter's options? If so, how are you making your call? You shouldn't need to do any of this when making an update, because your update shouldn't be in the url.
Views
Replies
Total Likes
The updates are in the JSON object in the body of the POST request.
e.g.
{
"name":"test",
"DE:Paramater Name":"123",
"DE:Paramater Name 2?":"456"
}
The name of the parameter here has a question mark. When I submit it, it then tells me it can't find the parameter with that name.
Views
Replies
Total Likes
If it's in the body then you shouldn't need to escape it, are you sure that's the name?
Views
Replies
Total Likes
That was my initial thought, so I pulled the API name out via the API (POSTMan) then copied and pasted in to Fusion. So just assumed I needed to escape the character.
Views
Replies
Total Likes
Oh No. I've found the solution, my category ID was actually incorrect.
Slightly embarrassing
Sorry for wasting your time.
Rob
Views
Replies
Total Likes
No worries, glad you figured it out!
Views
Replies
Total Likes
Views
Likes
Replies