code: def resource_create_ticket(self, token, id, scopes, **kwargs):
          
          data = dict(resource_id=id, resource_scopes=scopes, **kwargs)
          return self._realm.client.post(
              self.well_known['permission_endpoint'],
              data=self._dumps([data]),
              headers=self.get_headers(token)
          )
docs: Create a ticket form permission to resource.
  
          https://www.keycloak.org/docs/latest/authorization_services/index.html#_service_protection_permission_api_papi
  
          :param str token: user access token
          :param str id: resource id
          :param list scopes: scopes access is wanted
          :param dict claims: (optional)
          :rtype: dict