-1

I have a json response as below. I want to replace the URL which exist in JSON response from

https://abc.oktapreview.com/api/

to

https://abc-dallas-ext-non-prod-ingress.ccc.abc.com/v1/conn/api/v1

My JSON response is as

[
    {
        "id": "00uafl8w1l5E5eeADcx7",
        "status": "ACTIVE",
        "created": "2017-05-10T15:34:18.000Z",
        "activated": "2017-05-10T15:34:18.000Z",
        "statusChanged": "2020-01-08T19:54:55.000Z",
        "lastLogin": "2022-05-17T13:31:39.000Z",
        "lastUpdated": "2022-03-18T12:03:30.000Z",
        "passwordChanged": null,
        "type": {
            "id": "00uafl8w1l5E5eeADcx7"
        },
        "profile": {
            "zzOpCo": "ABC",
            "lastName": "Test",
            "samAccountName": "TEST123",
            "secondEmail": null,
            "zzCountry": "US",
            "login": "test123@mgd.abc.com",
            "zzCity": "HBK",
            "employeeNumber": "1234",            
            "email": "test.a@abc.com"
        },
        "credentials": {
            "provider": {
                "type": "ACTIVE_DIRECTORY",
                "name": "abc.zx.com"
            }
        },
        "_links": {
            "self": {
                "href": "https://abc.oktapreview.com/api/v1/users/00uafl8w1l5E5eeADcx7"
            }
        }
    }
]

How can this be done using javascript

Pravin
  • 1
  • 3
  • Just [replace](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replaceAll) the string in the JSON before you parse it – Phil May 19 '22 at 05:17

0 Answers0