Here's a question about the use of JSON to make a label:
I would like to create a label with label and message accroding to the return value of API, with information like the handle, and I need to use the message with a combination of two values.
How do to it?
By the way, how about color depending on API return values(a interger)?
Hello.
The dynamic JSON badge can grab a value from a JSON endpoint using JSONPath but the label and color are static.
If you want to create a badge based on a response from custom API which varies the label and color as well based on the API response, you'll need to write your own script to query that API and transform the response. Then you can use the endpoint badge: https://shields.io/endpoint
RunKit endpoints are a popular way to host them: https://runkit.com/docs/endpoint
If you have any more questions, please let us know!
Most helpful comment
Hello.
The dynamic JSON badge can grab a value from a JSON endpoint using JSONPath but the label and color are static.
If you want to create a badge based on a response from custom API which varies the label and color as well based on the API response, you'll need to write your own script to query that API and transform the response. Then you can use the endpoint badge: https://shields.io/endpoint
RunKit endpoints are a popular way to host them: https://runkit.com/docs/endpoint