Hi Syed,
Please try:
($httpVerb() = 'POST' and $contains($string(client.app.name), 'Default-Test'))
I also don't believe the $string function is required, so you can also try without it
($httpVerb() = 'POST' and $contains(client.app.name, 'Default-Test'))
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Thu February 22, 2024 01:36 PM
From: Syed Imtiyaz Alam
Subject: Getting application name(X-IBM-Client) in gateway Policy
Thank you Steve. I am trying to use this variable on the Switch and getting some validation error
I tried with this below:
($httpVerb() = 'POST' and $contains($string($client_app_name),
Default-Test))
Any suggestions please.
------------------------------
Syed Imtiyaz Alam
Original Message:
Sent: Thu February 01, 2024 11:52 AM
From: Steve Linn
Subject: Getting application name(X-IBM-Client) in gateway Policy
Hi Syed,
See https://www.ibm.com/docs/en/api-connect/10.0.5.x_lts?topic=reference-api-connect-context-variables. The client name is in the context variable client.app.name. Assuming you're using GatewayScript in an API Gateway API, you would access it with
let clientName = context.get('client.app.name');
In XSLT,
<xsl:variable name="clientID" select="apigw:get-variable('client.app.name')"/>
where our course your xsl:stylesheet has provided the correct namespace associated with the apigw prefix.
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Thu February 01, 2024 08:19 AM
From: Syed Imtiyaz Alam
Subject: Getting application name(X-IBM-Client) in gateway Policy
Hi ,
Is there any way we can retrieve the name of the X-IBM-Client based on X-IBM-Client-Id in gateway policy or any other way.
I want the name during runtime of the api.
Thank you
------------------------------
Syed Imtiyaz Alam
------------------------------