API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#API Connect
#Applicationintegration
#APIConnect
 View Only

How to pass context varaiblr to a policy

  • 1.  How to pass context varaiblr to a policy

    Posted yesterday

    Hi Teams,

    I want to know about how I can used my Context variable my which is set in gateway script 
    var apim = require('apim')
    var body = apim.getvariable('message.body');
    var bankId = body.item(0).getElementsByTagName("bankId").item(0).textContent;
    var serviceId = body.item(0).getElementsByTagName("serviceId").item(0).textContent;
    apim.setvariable("serviceId",serviceId); 

    I want to be used seviceId value on assembly rate-limite


    I have tried this $(serviceId) and also this serviceId it didn't work. 

    Please suggested how can I used it.

    Thank you,



    ------------------------------
    Shah Wajahat
    ------------------------------