This endpoint allows you to send a list of items and receive a randomly selected item from that list. It’s useful when you want to pick a random item from a given set of options.
Endpoint Information
- Method: POST
- Endpoint URL: https://node.nodetrigger.com/api/random-item
- Content Type: application/json
Example Requests
To make a request, you’ll need to send a list of items in the body of the request. You can provide the items as an array or a comma-separated string.
Example with Array
{ "items": ["apple", "banana", "cherry"] }
Example with Comma-separated String
{ "items": "apple, banana, cherry" }
Notes
- Ensure that the items field is included in the request body, either as an array or a comma-separated string.
- If the items list is not provided or is empty, the endpoint will return an error with the message: “No items provided or the items list is empty”.
- This endpoint is designed to return just one randomly selected item from the provided list each time you call it.
“`