Hi Lenny,
Your error shows, that rest call failed due to the Authorization error.
Did you passed valid API Credentials in Username and password field or valid authorization token
In addition to Stella’s answer.
For a better use, you can use an Export Mapping instead of a custom template. With an Export Mapping, you can use the entities of your domain model.