First autenticate with email/password:

curl -v 'https://email%40domain:password@api.coinext.com.br:8443/AP/authenticate'

If you have 2FA enabled you need to send the code now:

curl -v -d '{"Code": "THE CODE"}' \
  -H 'Content-type: application/json' \
  -H 'Pending2FaToken: ' \
  'https://api.coinext.com.br:8443/AP/Authenticate2FA'

With the returned aptoken you can retrieve the UserId:

curl -v -X POST 'https://api.coinext.com.br:8443/AP/GetUserInfo' \
  -d '{}' \
  -H 'Content-type: application/json' \
  -H 'aptoken: MY_AP_TOKEN'

And with the UserId you can ask for the APIKey:

curl -v -X POST 'https://api.coinext.com.br:8443/AP/AddUserAPIKey' \
 -d '{"UserId": USER_ID, "Permissions": ["Trading"]}' \
 -H 'Content-type: application/json' \
 -H 'aptoken: MY_AP_TOKEN'

This will return a json with the key and secret:

{
  "APIKey": "MY_API_KEY",
  "APISecret": "MY_API_SECRET",
  "UserId": "USER_ID",
  "Permissions": ["Trading"],
  "Nonce": 0
}