URL encoding while filtering REST API Information
search cancel

URL encoding while filtering REST API Information

book

Article ID: 336913

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

This article provides information about URL encoding while filtering REST API Information.

Symptoms:



Environment

VMware vRealize Automation 6.2.x

Resolution

The $ character has special meaning in a command-line context, you might need to URL-encode an $orderby or a $filter to %24orderby or %24filter. URL encoding is important for spaces, quotes and double quotes.

For example, these curl queries returns successful requests:
  • curl -H "Accept: $ACCEPT" -H "Authorization: $AUTH" https://$VRA/catalog-service/api/consumer/requests?%24filter=catalogItem/name+eq+'Small+Linux'
  • curl --insecure -H "Accept: application/json" -H "Authorization: $AUTH" https://$VRA/catalog-service/api/consumer/requests?%24filter=requestCompletion/requestCompletionState+eq+'SUCCESSFUL'

Note: You must URL encode all filter parameters when using Curl commands.