Skip to main content
deleted 26 characters in body
Source Link
rSh
  • 11
  • 1
  • 3

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{
    "glossary": [
        {
            "Title": "example glossary1",
            "id": 1,
            "description": "Hello Glossary1"
        },
        {
            "Title": "example glossary2",
            "id": 2,
            "description": "Hello Glossary2"
        },
        {
            "Title": "example glossary3",
            "id": 3,
            "description": "Hello Glossary3"
        },
        {
            "Title": "example glossary4",
            "id": 4,
            "description": "Hello Glossary4"
        }
    ]
}

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ ))
do 
     POST REST API 
done

Can anyone help with this?

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{
    "glossary": [
        {
            "Title": "example glossary1",
            "id": 1,
            "description": "Hello Glossary1"
        },
        {
            "Title": "example glossary2",
            "id": 2,
            "description": "Hello Glossary2"
        },
        {
            "Title": "example glossary3",
            "id": 3,
            "description": "Hello Glossary3"
        },
        {
            "Title": "example glossary4",
            "id": 4,
            "description": "Hello Glossary4"
        }
    ]
}

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ ))
do 
     POST REST API 
done

Can anyone help with this?

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{
    "glossary": [
        {
            "Title": "example glossary1",
            "id": 1,
            "description": "Hello Glossary1"
        },
        {
            "Title": "example glossary2",
            "id": 2,
            "description": "Hello Glossary2"
        },
        {
            "Title": "example glossary3",
            "id": 3,
            "description": "Hello Glossary3"
        },
        {
            "Title": "example glossary4",
            "id": 4,
            "description": "Hello Glossary4"
        }
    ]
}

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ ))
do 
     POST REST API 
done
added 252 characters in body; edited tags
Source Link
Runium
  • 30.1k
  • 5
  • 57
  • 77

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{
    "glossary": [
        {
            Title“"Title": "example glossary1”glossary1",
            id”"id": 1,
            "description": “Hello"Hello Glossary1“Glossary1"
        },
        {
            Title“"Title": "example glossary2”glossary2",
            id”"id": 2,
            "description": “Hello"Hello Glossary2“Glossary2"
        },
        {
            Title“"Title": "example glossary3”glossary3",
            id”"id": 3,
            "description": “Hello"Hello Glossary3“Glossary3"
        },
        {
            Title“"Title": "example glossary4”glossary4",
            id”"id": 4,
            "description": “Hello"Hello Glossary4“Glossary4"
        }
 
    ]
}

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ ))
do 
     POST REST API 
done

Can anyone help with this?

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{
    "glossary": [{
            Title“: "example glossary1”,
            id”: 1,
            "description": “Hello Glossary1“
        }, {
            Title“: "example glossary2”,
            id”: 2,
            "description": “Hello Glossary2“
        }, {
            Title“: "example glossary3”,
            id”: 3,
            "description": “Hello Glossary3“
        }, {
            Title“: "example glossary4”,
            id”: 4,
            "description": “Hello Glossary4“
        }
 
    ]
}

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ ))
do 
     POST REST API 
done

Can anyone help with this?

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{
    "glossary": [
        {
            "Title": "example glossary1",
            "id": 1,
            "description": "Hello Glossary1"
        },
        {
            "Title": "example glossary2",
            "id": 2,
            "description": "Hello Glossary2"
        },
        {
            "Title": "example glossary3",
            "id": 3,
            "description": "Hello Glossary3"
        },
        {
            "Title": "example glossary4",
            "id": 4,
            "description": "Hello Glossary4"
        }
    ]
}

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ ))
do 
     POST REST API 
done

Can anyone help with this?

added 252 characters in body; edited tags
Source Link
Runium
  • 30.1k
  • 5
  • 57
  • 77

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{ "glossary": [ { “Title“: "example glossary1”, “id”: 1, "description": “Hello Glossary1“ }, { “Title“: "example glossary2”, “id”: 2, "description": “Hello Glossary2“ }, { “Title“: "example glossary3”, “id”: 3, "description": “Hello Glossary3“ }, { “Title“: "example glossary4”, “id”: 4, "description": “Hello Glossary4“ }

] }

{
    "glossary": [{“
            Title“: "example glossary1”,“
            id”: 1,
            "description": “Hello Glossary1“
        }, {“
            Title“: "example glossary2”,“
            id”: 2,
            "description": “Hello Glossary2“
        }, {“
            Title“: "example glossary3”,“
            id”: 3,
            "description": “Hello Glossary3“
        }, {“
            Title“: "example glossary4”,“
            id”: 4,
            "description": “Hello Glossary4“
        }

    ]
}

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ )) do POST REST API done

for (( i = 0 ; i < ${#id[@]} ; i++ ))
do 
     POST REST API 
done

Can anyone help with this?

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{ "glossary": [ { “Title“: "example glossary1”, “id”: 1, "description": “Hello Glossary1“ }, { “Title“: "example glossary2”, “id”: 2, "description": “Hello Glossary2“ }, { “Title“: "example glossary3”, “id”: 3, "description": “Hello Glossary3“ }, { “Title“: "example glossary4”, “id”: 4, "description": “Hello Glossary4“ }

] }

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ )) do POST REST API done

Can anyone help with this?

I have a JSON output from which I need to extract an ID and Iterate through them and send multiple request to API execute REST API with curl. For example:

This is how the JSON output looks like:

{
    "glossary": [{“
            Title“: "example glossary1”,“
            id”: 1,
            "description": “Hello Glossary1“
        }, {“
            Title“: "example glossary2”,“
            id”: 2,
            "description": “Hello Glossary2“
        }, {“
            Title“: "example glossary3”,“
            id”: 3,
            "description": “Hello Glossary3“
        }, {“
            Title“: "example glossary4”,“
            id”: 4,
            "description": “Hello Glossary4“
        }

    ]
}

The shell script should loop through this JSON file, extract the ID and loop through and execute REST API calls with CURL.

Here is example:

for (( i = 0 ; i < ${#id[@]} ; i++ ))
do 
     POST REST API 
done

Can anyone help with this?

Source Link
rSh
  • 11
  • 1
  • 3
Loading