Hi Paul,
Since the SaaS Base Edition doesn't support the GatewayScript policy, I'm assuming the syntax you're showing is from a switch conditional. Switch conditionals use JSONata syntax where you'd use a single = equality operator, whereas the == is JavaScript syntax for an equality operator. If you were to make that change, do you still require the $apiCtx() function?
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Wed March 27, 2024 06:33 PM
From: Paul Dango
Subject: Client IP Address on Condition Editor
HI All,
We working in IBM APIC SaaS Base Edition.
In both case where we specify message.headers.x-client-ip == 'XXX.XXX.XXX.XXX' or session.clientAddress == 'XXX.XXX.XXX.XXX', we get a syntax error.
However when we specify $apiCtx().session.clientAddress = 'xxx.xxx.xxx.xxx' or $apiCtx().message.headers.x-client-ip = 'xxx.xxx.xxx.xxx', it works.
Thanks,
Paul
------------------------------
Paul Dango
------------------------------
Original Message:
Sent: Thu January 04, 2024 03:40 PM
From: Steve Linn
Subject: Client IP Address on Condition Editor
Hi Rajesh,
See https://www.ibm.com/docs/en/api-connect/10.0.5.x_lts?topic=reference-api-connect-context-variables, the variable name has a lower case c not a capital C, ie, session.clientAddress.
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM