Trouble with apoc.load.jsonParams


I'm trying to use apoc.load.jsonParams with headers parameters.

I've a problem with this statement :

WITH 'https://myurl' AS uri
CALL apoc.load.jsonParams(uri, {access-username:  'xxxxxxxxxx', access-password: 'yyyyyyyy'}, null)
YIELD value
RETURN value

I get this error :

Neo.ClientError.Statement.SyntaxError: Invalid input '-': expected an identifier character, whitespace, '}' or ':' (line 2, column 34 (offset: 128))
"CALL apoc.load.jsonParams(uri, {access-username:  'xxxxxxxxxx', access-password: 'yyyyyyyyy'}, null)"

There is a solution to use key containing "-" ?
The API I try to call is not modifiable..

By advance, thanks you!

Map keys containing "special" characters (e.g. -, space, umlauts...) need to be quoted into backticks:

return {`access-username`: "abc"}
1 Like

Thanks you! It works :slight_smile: