How can i receive an Array of request and send response for each array value


I have a requirement where user can pass multiple values to a key under an array. i want the app to run the validation for each value in the array and print the response accordingly.

Example input:

“ticket”: [
“user”: “xyzasb”

i want the tickets [abc, def, ghi] to be passed as input variable to a third party api with get method and print the received response one another below.

(Lutz Horn) #2

I don’t quite understand your question. Which part of this requirement are you having problems with? What did you already implement, what is missing?


My current implementation accepts only single value for key “ticket” and gives out the response. Now i want the value for key to be multiple array and return the desired response for each value.

(amnon bc) #4

show us the code


Request Data is something like this

“tickets”: [ “INC0012345678”,
“IncludeDetail”: true,
“mwuser”: “abcd”

third party api url differs based on ticket type if first 3 character are INC it will call
if CHG then URL = B

based on the selected URL i will perform the client.Get

//Third Party SNOW API Call
var snowapiresp *http.Response
if strings.Contains(SnowTicket, “INC”) {
snowapiresp, err = client.Get(fmt.Sprintf(SnowInc + SnowTicket))
if err != nil {
} else {
snowapiresp, _ = client.Get(fmt.Sprintf(SnowChg + SnowTicket))
if err != nil {

and print the response for each ticket number