Yandex Cloud
Search
Discuss with expertTry 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
    • Error handling
  • 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 with the Yandex Cloud APIs
  1. Developing in PHP
  2. Invocation context

PHP function invocation context

Written by
Yandex Cloud
Updated at July 2, 2026
View in Markdown
  • Using the invocation context
    • Authentication with the Yandex Cloud APIs

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

This object 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, in MB.
  • getRequestId(): Returns the request ID.
  • getToken(): Returns the parameters for authentication with the Yandex Cloud APIs.

Using the invocation contextUsing the invocation context

You can use the invocation context to authenticate with the Yandex Cloud APIs.

Authentication with the Yandex Cloud APIsAuthentication with the Yandex Cloud APIs

If you specified a service account for the function, the getToken() method will return a structure with authentication information for that account. 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.