Are you running the json-api separately with the daml json-api
command? You’d do something like the below to connect your json-api to the ledger api (via the ledger flags below) which would give an endpoint that Daml Script could use in json-api mode.
daml json-api --ledger-host localhost --ledger-port 6865 --address 127.0.0.1 --http-port 7575
But if you’re able to just have Daml Scripts talk to the Ledger API then no need to have the JSON API in between.