Skip to main content
Question

Single quote (apostrophe) in published parameter when submitting a job through FME REST


nielsgerrits
VIP
Forum|alt.badge.img+54

We have a workspace on FME server (2021.2.6) with a published parameter ProjectName.

We're submitting jobs through the REST enpoint, using json for the parameters.

Now we have a project name with an single quote (apostrophe), like:

A'dam

This results in a code 400 - bad request.

 

So, what is the correct way to send this string in the json? What we have tried:

A%27dam

This works, but then we need to decode the string in workbench.

A\'dam

This works, but server interprets this as as a double quote.

A"dam

We also tried to replicate this in submitting a job from the fme server interface but then the parameters are sent as form data, not as json...

2 replies

merlinegeorge
Safer
Forum|alt.badge.img+5

Hello @nielsgerrits​ ,

 

Could you please test if this works- To use an apostrophe or a single quotation mark (') in a value, add another single quotation mark after the first one.

For example - the value O'Hara can be submitted as  "O''HARA".


nielsgerrits
VIP
Forum|alt.badge.img+54
merlinegeorge wrote:

Hello @nielsgerrits​ ,

 

Could you please test if this works- To use an apostrophe or a single quotation mark (') in a value, add another single quotation mark after the first one.

For example - the value O'Hara can be submitted as  "O''HARA".  

Hej @Merline George​ , thanks for looking into this. I tried replacing a single quote with 2 single quotes:

{
	"TMDirectives": {
		"ttl": 60,
		"description": "",
		"priority": 100,
		"tag": "Normal"
	},
	"publishedParameters": [
		{
			"name": "ProjectNaam",
			"value": "A''dam"
		}
	],
	"subsection": "REST_SERVICE"
}

But I still get

The remote server returned an error: (400) Bad Request.

when submitting the job. We initiate the job using /fmerest/v3/transformations/submit/.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings