Hi All,
back from vacation things look much easier. No problems any more 
Here is shell equivalent of sample php script RESTAPIphpListClient.php provided on GitHub:
#!/bin/bash
loginname=‘admin’
password=‘password’
base_uri=’ ’ # I had to remove my base uri, as far as site does not permits me to publish it
#Initialize session
echo “Itializing session…”
response=curl --request POST --url "${base_uri}/sessions" --header 'Content-Type: application/json' --data "{\"login_name\": \"$loginname\",\"password\": \"password\"}"
#$response=’{“expiry”:“2019-08-17T18:37:27+00:00”,“key”:“3de46ddd6930def96bf1ac63d38e1985”,“id”:94}’
echo $response
#Extract sesson key from response
key=echo $response | jq '.key' | sed -e 's/^"//' -e 's/"$//'
echo “Got session key: $key”
#Use session key as password for basic auth
credentials=echo -n "$loginname:$key" | base64
echo “Encoded credentials: $credentials”
#echo $credentials | base64 --decode
#Get list info where id=1 (pipe to jq. to make result more readable
echo “Get list info where id=1”
curl --location --request GET “${base_uri}/lists/1” --header “Content-Type: application/json” --header “Authorization: Basic $credentials” | jq .
#Get all subscribers where list id=1
echo “Get all subscribers where list id=1”
curl --location --request GET “${base_uri}/lists/1/members” --header “Content-Type: application/json” --header “Authorization: Basic $credentials” | jq .
#Add a new subscriber
echo “Add a new subscriber”
curl --location --request POST “${base_uri}/subscribers”
–header “Content-Type: application/json”
–header “Authorization: Basic $credentials”
–data “{“email”:“restapi7@example.com”,“confirmed”:true,“blacklisted”:false,“html_email”:true,“disabled”:false}” | jq .
And below is the script output:
Itializing session…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 134 100 88 100 46 644 336 --:–:-- --:–:-- --:–:-- 647
{“expiry”:“2019-08-20T09:36:57+00:00”,“key”:“bb3bb3df05484aab008831853fe5e764”,“id”:174}
Got session key: bb3bb3df05484aab008831853fe5e764
Encoded credentials: YWRtaW46YmIzYmIzZGYwNTQ4NGFhYjAwODgzMTg1M2ZlNWU3NjQ=
Get list info where id=1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 128 100 128 0 0 903 0 --:–:-- --:–:-- --:–:-- 907
{
“name”: “test”,
“description”: “List for testing”,
“creation_date”: “2019-07-02T11:29:16+00:00”,
“public”: false,
“category”: “”,
“id”: 1
}
Get all subscribers where list id=1
./CURL_Tests.bash: line 41: unexpected EOF while looking for matching `"’
./CURL_Tests.bash: line 43: syntax error: unexpected end of file
leonid@leonid-ThinkPad-T520:~/Projects/Allegro/HoneyPOT/20190627_PHPListCcontainer/REST_API$ ./CURL_Tests.bash
Itializing session…
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 134 100 88 100 46 655 342 --:–:-- --:–:-- --:–:-- 656
{“expiry”:“2019-08-20T09:38:09+00:00”,“key”:“68f2b04d9641f0a9df096d1a83a4727d”,“id”:175}
Got session key: 68f2b04d9641f0a9df096d1a83a4727d
Encoded credentials: YWRtaW46NjhmMmIwNGQ5NjQxZjBhOWRmMDk2ZDFhODNhNDcyN2Q=
Get list info where id=1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 128 100 128 0 0 855 0 --:–:-- --:–:-- --:–:-- 853
{
“name”: “test”,
“description”: “List for testing”,
“creation_date”: “2019-07-02T11:29:16+00:00”,
“public”: false,
“category”: “”,
“id”: 1
}
Get all subscribers where list id=1
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 216 100 216 0 0 1468 0 --:–:-- --:–:-- --:–:-- 1479
[
{
“creation_date”: “2019-07-02T11:29:16+00:00”,
“email”: "leon@us.ibm.com",
“confirmed”: true,
“blacklisted”: false,
“bounce_count”: 0,
“unique_id”: “047355177e01fac11435bd3abda4b18f”,
“html_email”: true,
“disabled”: false,
“id”: 1
}
]
Add a new subscriber
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 339 100 235 100 104 1352 598 --:–:-- --:–:-- --:–:-- 1358
{
“creation_date”: “2019-08-20T08:38:09+00:00”,
“email”: "restapi7@example.com",
“confirmed”: true,
“blacklisted”: false,
“bounce_count”: 0,
“unique_id”: “7108f6352dec2c1d1d3bd6720fd8981f”,
“html_email”: true,
“disabled”: false,
“extra_data”: “”,
“id”: 9
}
}