Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Functions
  • Comparing with other Yandex Cloud services
    • Overview
    • Managing dependencies
    • Request handler
    • Invocation context
    • Logging
    • Handling errors
  • Tools
  • Pricing policy
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes
  • FAQ

In this article:

  • Using the invocation context
  • Authentication in the Yandex Cloud API
  1. Developing in PHP
  2. Invocation context

PHP function invocation context

Written by
Yandex Cloud
Updated at March 31, 2026
  • Using the invocation context
    • Authentication in the Yandex Cloud API

Invocation context is an object that is accepted by the request handler of a PHP function as the second argument.

An invocation context is an object that provides additional information about a PHP function version properties. To get this information in your program, use the following methods:

  • getFunctionFolderId(): Returns the folder containing the function.
  • getFunctionId(): Returns the string ID of the function.
  • getFunctionVersionId(): Returns the string ID of the function version.
  • getMemoryLimitInMB(): Returns the amount of memory specified when creating the version, MB.
  • getRequestId(): Returns the request ID.
  • getToken(): Returns the parameters for authentication in the Yandex Cloud API.

Using the invocation contextUsing the invocation context

You can use the invocation context to authenticate in the Yandex Cloud API.

Authentication in the Yandex Cloud APIAuthentication in the Yandex Cloud API

If a function specifies a service account, the getToken() method will return a structure with information for account authentication. You can use the following methods to get this information:

  • getAccessToken(): IAM token.
  • getExpiresIn(): Token lifetime in seconds.
  • getTokenType(): Token type, e.g.,Bearer.

You can also get this information using the metadata service. For more information about this method, see Authentication from within a VM.

Was the article helpful?

Previous
Request handler
Next
Logging
© 2026 Direct Cursus Technology L.L.C.