API connection problem and getting token

I have a problem with api connection, I'm writting this script below:
curl -H 'x-api-key: KEY_API' -X GET 'https://www.your-metabase.com/api/permissions/group'

and I get following errors:
curl: (6) Could not resolve host: ....
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535

or: Unauthorized

And when I want to get a token, I use following script:
curl -X POST
-H “Content-Type: application/json”
-d ‘{“username”: “email@domain.com“, “password”: “MetabasePassword”}’
http://localhost:8443/api/session

but any way I get an error:
curl: (3) URL rejected: Bad hostname
curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535
curl: (3) unmatched close brace/bracket in URL position 13:

Are you changing the host in the API KEY one? . Share with me the exact call you are sending and obscure the key