Taking it from [Content-Migration] katello:correct_repositories and correct_puppet_environments fails blocking migration:
The low level method using curl is like this:
# curl --cert /etc/foreman/client_cert.pem --key /etc/foreman/client_key.pem 'https://foreman.example.com/pulp/api/v3/tasks/31fee624-f68b-4650-91fd-71fc7938266c/' | python -m json.tool
Together with the Pulp 3 REST API documentation
When checking for task output just make sure not to confuse the foreman task id with the pulp3 task id as both are uuids.