Rest API query parameter search with special character

In a workflow I have to include the REST API component and search a user in the NERM through his profile attribute. In the user’s attribute has a special character like “+” sign, while “+” sign is considered as a space in the REST API query parameter.

So, please suggest how we can replace the “+” sign with “%2B” while passing to the REST API query parameter.

NERM supports the Liquid templating language in REST API actions. (Liquid docs here: Liquid template language

With that, you could use the “url_encode” filter for the plus sign. For example, if you are making an Advanced Search API call like:

{
        "type": "ProfileAttributeRule",
        "condition_object_type": "TextFieldAttribute",
        "condition_object_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "comparison_operator": "==",
        "value": "{{attribute.first_name}}"
}

You could change that value to be encoded:

"value": "{{attribute.first_name | url_encode }}"
2 Likes