Have you read the [Grant spec](https://gluu.co/uma-grant)? That's important.
Also, if you are implementing an API that needs to return a ticket, you need to read the [Federated Authorization spec](https://gluu.co/uma-authz)
Finally, you should read the [Gluu Docs on UMA](https://gluu.org/docs/gluu-server/4.2/admin-guide/uma/)
And after that, you can raise a more specific question about where you're stuck.