API Requests
Making API requests in Laminar
Last updated
Was this helpful?
Was this helpful?
(payload) => {
const { input } = payload;
return {
"lam.httpRequest": {
"method": "POST",
"url": "{{props.baseUrl}}/orders",
"headers": {
"Authorization": "Bearer {{props.apiKey}}",
"Content-Type": "application/json"
},
"body": {
"orderId": input.orderId,
"items": input.items
}
}
};
}.input |
{
"lam.httpRequest": {
"method": "POST",
"url": "{{props.baseUrl}}/orders",
"headers": {
"Authorization": "Bearer {{props.apiKey}}",
"Content-Type": "application/json"
},
"body": {
"orderId": .orderId,
"items": .items
}
}
}(payload) => {
const { input } = payload;
return {
"lam.httpRequests": input.items.map(item => ({
"method": "GET",
"url": "{{props.baseUrl}}/inventory/{{itemId}}",
"pathParams": {
"itemId": item.id
}
}))
};
}.input.items |
{
"lam.httpRequests": map({
"method": "GET",
"url": "{{props.baseUrl}}/inventory/{{itemId}}",
"pathParams": {
"itemId": .id
}
})
}{
"url": "{{props.baseUrl}}/api/{{version}}/orders",
"headers": {
"Authorization": "Bearer {{props.apiKey}}"
}
}