:doc:`BedrockAgentCore <../../bedrock-agentcore>` / Client / get_workload_access_token_for_user_id

*************************************
get_workload_access_token_for_user_id
*************************************



.. py:method:: BedrockAgentCore.Client.get_workload_access_token_for_user_id(**kwargs)

  

  Obtains a workload access token for agentic workloads acting on behalf of a user, using the user's ID.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/bedrock-agentcore-2024-02-28/GetWorkloadAccessTokenForUserId>`_  


  **Request Syntax**
  ::

    response = client.get_workload_access_token_for_user_id(
        workloadName='string',
        userId='string'
    )
    
  :type workloadName: string
  :param workloadName: **[REQUIRED]** 

    The name of the workload from which you want to retrieve the access token.

    

  
  :type userId: string
  :param userId: **[REQUIRED]** 

    The ID of the user for whom you are retrieving the access token.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'workloadAccessToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **workloadAccessToken** *(string) --* 

        The access token for the specified workload.

        
  
  **Exceptions**
  
  *   :py:class:`BedrockAgentCore.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.ValidationException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.ThrottlingException`

  
  *   :py:class:`BedrockAgentCore.Client.exceptions.InternalServerException`

  