This is a Bash client script for accessing GroupBy Retail service.
The script uses cURL underneath for making all REST calls.
# Make sure the script has executable rights
$ chmod u+x gb-retailapi-client
# Print the list of operations available on the service
$ ./gb-retailapi-client -h
# Print the service description
$ ./gb-retailapi-client --about
# Print detailed information about specific operation
$ ./gb-retailapi-client <operationId> -h
# Make GET request
./gb-retailapi-client --host http://<hostname>:<port> --accept xml <operationId> <queryParam1>=<value1> <header_key1>:<header_value2>
# Make GET request using arbitrary curl options (must be passed before <operationId>) to an SSL service using username:password
gb-retailapi-client -k -sS --tlsv1.2 --host https://<hostname> -u <user>:<password> --accept xml <operationId> <queryParam1>=<value1> <header_key1>:<header_value2>
# Make POST request
$ echo '<body_content>' | gb-retailapi-client --host <hostname> --content-type json <operationId> -
# Make POST request with simple JSON content, e.g.:
# {
# "key1": "value1",
# "key2": "value2",
# "key3": 23
# }
$ echo '<body_content>' | gb-retailapi-client --host <hostname> --content-type json <operationId> key1==value1 key2=value2 key3:=23 -
# Make POST request with form data
$ gb-retailapi-client --host <hostname> <operationId> key1:=value1 key2:=value2 key3:=23
# Preview the cURL command without actually executing it
$ gb-retailapi-client --host http://<hostname>:<port> --dry-run <operationid>
You can easily create a Docker image containing a preconfigured environment for using the REST Bash client including working autocompletion and short welcome message with basic instructions, using the generated Dockerfile:
docker build -t my-rest-client .
docker run -it my-rest-clientBy default you will be logged into a Zsh environment which has much more advanced auto completion, but you can switch to Bash, where basic autocompletion is also available.
The generated bash-completion script can be either directly loaded to the current Bash session using:
source gb-retailapi-client.bash-completionAlternatively, the script can be copied to the /etc/bash-completion.d (or on OSX with Homebrew to /usr/local/etc/bash-completion.d):
sudo cp gb-retailapi-client.bash-completion /etc/bash-completion.d/gb-retailapi-clientOn OSX you might need to install bash-completion using Homebrew:
brew install bash-completionand add the following to the ~/.bashrc:
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fiIn Zsh, the generated _gb-retailapi-client Zsh completion file must be copied to one of the folders under $FPATH variable.
All URIs are relative to **
| Class | Method | HTTP request | Description |
|---|---|---|---|
| AutocompleteApi | autocompletesearch | GET /api/request | |
| ProductApi | getByProductIds | GET /api/search/product | Provided product search functionality |
| RecommendationsAPIApi | predict | POST /api/predict | Provide Recommendations AI functionality. |
| RecommendationsAPIApi | predictV2 | POST /api/recommendation | Provide Recommendations AI functionality. |
| SearchApi | facetSearch | POST /api/search/facet | Provided search functionality |
| SearchApi | search | POST /api/search | Provided search functionality |
- AdditionalInfo
- AttributeSuggestion
- Audience
- BiasDto
- BiasDtoStrengthDto
- BiasingProfileDto
- BoostedProductBucket
- ColorInfo
- CustomParameterDto
- CustomParameterTrigger
- DebugDto
- ErrorDto
- ErrorResponse
- Experiment
- ExperimentVariant
- Facet
- FacetSearchRequestDto
- FacetSearchResponseDto
- FieldMask
- Filter
- FilterParameter
- FulfillmentInfo
- Identity
- Image
- Interval
- Merchandiser
- MessageType
- Metadata
- NavigationDto
- NavigationType
- NavigationTypeDto
- Order
- Overwrites
- PageInfoDto
- PinnedRefinement
- PredictResults
- PriceInfo
- PriceInfoPriceEffectiveTime
- PriceInfoPriceExpireTime
- PriceInfoPriceRange
- PriceInfoPriceRangeOriginalPrice
- PriceInfoPriceRangePrice
- ProductCustomAttribute
- ProductDto
- ProductDtoAudience
- ProductDtoAvailableTime
- ProductDtoColorInfo
- ProductDtoPriceInfo
- ProductDtoPublishTime
- ProductDtoRating
- ProductDtoRetrievableFields
- Promotion
- QueryPatternTrigger
- QueryPatternTriggerType
- Range
- RangeFilter
- Rating
- RecommendationsErrorResponse
- RecommendationsRequest
- RecordDto
- Refinement
- RefinementDto
- Request
- Role
- RuleConfiguration
- RuleTemplate
- RuleTemplateSection
- RuleType
- RuleVariant
- SearchFilter
- SearchMetadataDto
- SearchRequestDto
- SearchRequestDtoOverwrites
- SearchResponseDto
- SearchResults
- SearchResultsStats
- SearchTerms
- SelectedRefinementDto
- SelectedRefinementTrigger
- SelectedRefinementTriggerType
- Sort
- SortDto
- SortDtoOrderDto
- SpellCorrectionMode
- Stats
- TemplateDto
- TemplateDtoTriggerSet
- Timestamp
- TriggerSet
- ValueFilter
- ValueFilterValueFilterType
- ZoneDto
- ZoneDtoType
- ZoneType
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
- Type: HTTP basic authentication