Azure / Azure/api-management-policy-snippets

How to use set-body template="liquid" to access request body json attribute?

Open
#111 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
399
Forks
170
PR merge metrics
No merged PRs in 30d

Description

Hi,

The official documentation mentions that set-body can access request body here https://learn.microsoft.com/en-us/azure/api-management/set-body-policy#using-liquid-templates-with-set-body

"The set-body policy can be configured to use the [Liquid](https://shopify.github.io/liquid/basics/introduction/) templating language to transform the body of a request or response. This can be effective if you need to completely reshape the format of your message."

I would like to use set-body to access the request body json and extract specific property, so that It can be use to craft request body for another request.

How to achieve this?

I tried accessing by "body.argument." doesn't work.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked Azure API Management set-body policy documentation and its Liquid template examples. Compare those examples with the reported body.argument. attempt and determine how request-body JSON properties are accessed. Done means documenting a working expression for extracting a property and using it in another request body.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, json
Domain
api, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.