### Install msgraph-core and azure-identity Source: https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/main/README.md Install the necessary packages for using the Microsoft Graph Core Python Client Library and Azure identity management. ```cmd pip3 install msgraph-core pip3 install azure-identity ``` -------------------------------- ### Install msgraph-core and azure-identity Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Install the necessary packages for using the Microsoft Graph Core Python Client Library and Azure Identity for authentication. ```bash pip install msgraph-core pip install azure-identity ``` -------------------------------- ### Make an Asynchronous Request to Microsoft Graph Source: https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/main/README.md Make an asynchronous GET request to the Microsoft Graph API to retrieve user information. Ensure you have a User type that implements Parsable or comes from the service library. ```python import asyncio from kiota_abstractions.request_information import RequestInformation request_info = RequestInformation() request_info.url = 'https://graph.microsoft.com/v1.0/me' # User is your own type that implements Parsable or comes from the service library user = asyncio.run(adapter.send_async(request_info, User, {})) print(user.display_name) ``` -------------------------------- ### Initialize and Use BaseGraphRequestAdapter Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Demonstrates how to initialize the BaseGraphRequestAdapter with an authentication provider and use it to send asynchronous requests. Ensure the model used for deserialization is Parsable. ```python import asyncio from azure.identity.aio import ClientSecretCredential from kiota_abstractions.request_information import RequestInformation from kiota_abstractions.method import Method from msgraph_core import BaseGraphRequestAdapter, AzureIdentityAuthenticationProvider credential = ClientSecretCredential("TENANT", "CLIENT_ID", "CLIENT_SECRET") auth_provider = AzureIdentityAuthenticationProvider(credential) adapter = BaseGraphRequestAdapter(auth_provider) async def get_me(): request_info = RequestInformation() request_info.http_method = Method.GET request_info.url = "https://graph.microsoft.com/v1.0/me" # User must be a Parsable type; replace with your SDK-generated model user = await adapter.send_async(request_info, User, {{}}) print(user.display_name) asyncio.run(get_me()) ``` -------------------------------- ### Create httpx.AsyncClient with Default Middleware Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Construct an httpx.AsyncClient pre-loaded with the Kiota default middleware pipeline, including retry, redirect, auth, and Graph-specific telemetry. Use this for standard Graph-compatible HTTP clients. ```python import asyncio import httpx from msgraph_core import GraphClientFactory, APIVersion, NationalClouds # Global endpoint, v1.0 API (default) http_client: httpx.AsyncClient = GraphClientFactory.create_with_default_middleware() # US Government cloud, beta API http_client_gov = GraphClientFactory.create_with_default_middleware( api_version=APIVersion.beta, host=NationalClouds.US_GOV, ) # Bring your own pre-configured client existing_client = httpx.AsyncClient(timeout=30) wrapped_client = GraphClientFactory.create_with_default_middleware(client=existing_client) print(http_client.base_url) # https://graph.microsoft.com/v1.0 print(http_client_gov.base_url) # https://graph.microsoft.us/beta ``` -------------------------------- ### Initialize BaseGraphRequestAdapter Source: https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/main/README.md Initialize the BaseGraphRequestAdapter by passing the configured authentication provider object. This adapter is used to build and send requests. ```python from msgraph_core import BaseGraphRequestAdapter adapter = BaseGraphRequestAdapter(auth_provider) ``` -------------------------------- ### Configure GraphTelemetryHandler with Custom Options Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Enables automatic appending of `sdkVersion`, `HostOs`, `RuntimeEnvironment`, and `client-request-id` headers to requests. Telemetry is opt-in per request via `GraphTelemetryHandlerOption`. Customize metadata like the consuming SDK version. ```python from msgraph_core import GraphClientFactory, APIVersion from msgraph_core.middleware import GraphTelemetryHandler from msgraph_core.middleware.options import GraphTelemetryHandlerOption # Customize telemetry metadata (e.g., set the consuming SDK version) telemetry_option = GraphTelemetryHandlerOption( api_version=APIVersion.v1, sdk_version="1.0.0", ) options = {GraphTelemetryHandlerOption.get_key(): telemetry_option} http_client = GraphClientFactory.create_with_default_middleware(options=options) # Resulting request headers will include: # sdkVersion: graph-python/1.0.0, graph-python-core/1.3.8 (featureUsage=...) # HostOs: Linux 5.15.0-... # RuntimeEnvironment: Python/3.11.x # client-request-id: ``` -------------------------------- ### Create httpx.AsyncClient with Custom Middleware Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Build an httpx.AsyncClient with a fully user-defined middleware chain, bypassing all Kiota defaults. This is useful for precise control over retry logic, logging, or request signing. ```python from kiota_http.middleware import RetryHandler, RedirectHandler from msgraph_core import GraphClientFactory, APIVersion from msgraph_core.middleware import GraphTelemetryHandler custom_middleware = [ RetryHandler(), # handles 429 / 503 automatically RedirectHandler(), # follows 3xx responses GraphTelemetryHandler(), # attaches SdkVersion / HostOs headers ] http_client = GraphClientFactory.create_with_custom_middleware( middleware=custom_middleware, api_version=APIVersion.v1, ) ``` -------------------------------- ### Create and Send Batch Requests Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Demonstrates how to aggregate multiple Graph API requests into a single batch request using `BatchRequestBuilder`, `BatchRequestContent`, and `BatchRequestItem`. This reduces network round-trips. Dependencies between requests can be specified. ```python import asyncio from kiota_abstractions.request_information import RequestInformation from kiota_abstractions.method import Method from kiota_abstractions.headers_collection import HeadersCollection from msgraph_core.requests import ( BatchRequestBuilder, BatchRequestContent, BatchRequestItem, ) from msgraph_core import BaseGraphRequestAdapter, AzureIdentityAuthenticationProvider from azure.identity.aio import ClientSecretCredential credential = ClientSecretCredential("TENANT", "CLIENT_ID", "SECRET") adapter = BaseGraphRequestAdapter(AzureIdentityAuthenticationProvider(credential)) batch_builder = BatchRequestBuilder(adapter) def make_request(path: str) -> BatchRequestItem: info = RequestInformation() info.http_method = Method.GET info.url = path info.headers = HeadersCollection() info.headers.try_add("Content-Type", "application/json") return BatchRequestItem(request_information=info) async def main(): item_me = make_request("/me") item_users = make_request("/users") # item_users depends on item_me completing first item_users_dep = make_request("/users") item_users_dep.set_depends_on([item_me]) content = BatchRequestContent({ item_me.id: item_me, item_users.id: item_users, }) response = await batch_builder.post(content) # Check individual status codes status_codes = response.get_response_status_codes() print(status_codes) # {'': 200, '': 200} # Get a specific response item me_item = response.get_response_by_id(item_me.id) print(me_item.status) # 200 print(me_item.headers) # {'content-type': 'application/json', ...} # Deserialize response body to a Parsable type # user = response.get_response_by_id(item_me.id, User) asyncio.run(main()) ``` -------------------------------- ### Configure Azure Identity Authentication Provider Source: https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/main/README.md Configure an authentication provider using EnvironmentCredential for demonstration. This is essential for authenticating requests to Microsoft Graph. For more options, refer to the azure-identity documentation. ```python # Using EnvironmentCredential for demonstration purposes. # There are many other options for getting an access token. See the following for more information. # https://pypi.org/project/azure-identity/#async-credentials from azure.identity.aio import EnvironmentCredential from msgraph_core.authentication import AzureIdentityAuthenticationProvider credential=EnvironmentCredential() auth_provider = AzureIdentityAuthenticationProvider(credential) ``` -------------------------------- ### BaseGraphRequestAdapter Usage Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Demonstrates how to initialize and use BaseGraphRequestAdapter to send asynchronous requests to the Microsoft Graph API. It shows creating a RequestInformation object, setting the HTTP method and URL, and sending the request with a specified Parsable type for deserialization. ```APIDOC ## BaseGraphRequestAdapter The central dispatcher that combines authentication, serialization, and HTTP transport. Pass it a `RequestInformation` object plus a `Parsable` type and it returns the deserialized response. This is the object used by the full Graph SDK internally. ```python import asyncio from azure.identity.aio import ClientSecretCredential from kiota_abstractions.request_information import RequestInformation from kiota_abstractions.method import Method from msgraph_core import BaseGraphRequestAdapter, AzureIdentityAuthenticationProvider credential = ClientSecretCredential("TENANT", "CLIENT_ID", "CLIENT_SECRET") auth_provider = AzureIdentityAuthenticationProvider(credential) adapter = BaseGraphRequestAdapter(auth_provider) async def get_me(): request_info = RequestInformation() request_info.http_method = Method.GET request_info.url = "https://graph.microsoft.com/v1.0/me" # User must be a Parsable type; replace with your SDK-generated model user = await adapter.send_async(request_info, User, {{}}) print(user.display_name) asyncio.run(get_me()) ``` ``` -------------------------------- ### Conventional Commit Message Format Source: https://github.com/microsoftgraph/msgraph-sdk-python-core/blob/main/CONTRIBUTING.md Follow this format for all commit messages to support the automated release process. Ensure a header with type and description, followed by an optional body and footer. ```text [optional scope]: ``` -------------------------------- ### Configure AzureIdentityAuthenticationProvider Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Wrap an azure-identity credential to automatically provide Bearer tokens for Microsoft Graph national-cloud endpoints. The default configuration covers all national clouds and uses the /.default scope. ```python from azure.identity.aio import ClientSecretCredential from msgraph_core import AzureIdentityAuthenticationProvider, NationalClouds credential = ClientSecretCredential( tenant_id="YOUR_TENANT_ID", client_id="YOUR_CLIENT_ID", client_secret="YOUR_CLIENT_SECRET", ) # Default: all national cloud hosts, /.default scope auth_provider = AzureIdentityAuthenticationProvider(credential) # Custom: restrict to global cloud only, explicit scopes auth_provider_custom = AzureIdentityAuthenticationProvider( credentials=credential, scopes=["https://graph.microsoft.com/.default"], allowed_hosts=[NationalClouds.Global], ) ``` -------------------------------- ### BatchRequestContent and BatchRequestItem Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Shows how to use BatchRequestContent and BatchRequestItem to aggregate multiple Graph requests into a single POST /$batch call. This reduces network round-trips. It covers creating individual request items, setting dependencies, and processing the batched response. ```APIDOC ## BatchRequestContent and BatchRequestItem Aggregates up to 20 individual Graph requests into a single `POST /$batch` call, reducing round-trips. `BatchRequestItem` wraps a `RequestInformation` or `urllib.request.Request` object; `BatchRequestContent` holds the collection and handles ordering, dependency declarations, and serialization. ```python import asyncio from kiota_abstractions.request_information import RequestInformation from kiota_abstractions.method import Method from kiota_abstractions.headers_collection import HeadersCollection from msgraph_core.requests import ( BatchRequestBuilder, BatchRequestContent, BatchRequestItem, ) from msgraph_core import BaseGraphRequestAdapter, AzureIdentityAuthenticationProvider from azure.identity.aio import ClientSecretCredential credential = ClientSecretCredential("TENANT", "CLIENT_ID", "SECRET") adapter = BaseGraphRequestAdapter(AzureIdentityAuthenticationProvider(credential)) batch_builder = BatchRequestBuilder(adapter) def make_request(path: str) -> BatchRequestItem: info = RequestInformation() info.http_method = Method.GET info.url = path info.headers = HeadersCollection() info.headers.try_add("Content-Type", "application/json") return BatchRequestItem(request_information=info) async def main(): item_me = make_request("/me") item_users = make_request("/users") # item_users depends on item_me completing first item_users_dep = make_request("/users") item_users_dep.set_depends_on([item_me]) content = BatchRequestContent({ item_me.id: item_me, item_users.id: item_users, }) response = await batch_builder.post(content) # Check individual status codes status_codes = response.get_response_status_codes() print(status_codes) # {'': 200, '': 200} # Get a specific response item me_item = response.get_response_by_id(item_me.id) print(me_item.status) # 200 print(me_item.headers) # {'content-type': 'application/json', ...} # Deserialize response body to a Parsable type # user = response.get_response_by_id(item_me.id, User) asyncio.run(main()) ``` ``` -------------------------------- ### Upload Large Files with LargeFileUploadTask Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Demonstrates how to upload large files using `LargeFileUploadTask`. Ensure the upload session object has `upload_url` and `expiration_date_time` attributes. The `on_progress` callback can be used to track upload progress. ```python async def upload_file(adapter, upload_session, file_path: str): with open(file_path, "rb") as f: file_stream = BytesIO(f.read()) task = LargeFileUploadTask( upload_session=upload_session, request_adapter=adapter, stream=file_stream, max_chunk_size=5 * 1024 * 1024, # 5 MB chunks ) def on_progress(uploaded_range: list): print(f"Uploaded bytes: {uploaded_range[0]} – {uploaded_range[1]}") result = await task.upload(after_chunk_upload=on_progress) if result.item_response: print(f"Upload complete. Item ID: {result.item_response.id}") print(f"Upload URL: {result.location}") # Cancel an in-progress upload # await task.cancel() # Resume after interruption # await task.resume() asyncio.run(upload_file(adapter, upload_session, "large_presentation.pptx")) ``` -------------------------------- ### Utilize APIVersion and NationalClouds Enums Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Shows how to use the APIVersion and NationalClouds enums for specifying Graph API versions and national cloud endpoints. These enums are subclasses of `str` and can be directly interpolated into URL strings. ```python from msgraph_core import APIVersion, NationalClouds print(APIVersion.v1) # v1.0 print(APIVersion.beta) # beta print(NationalClouds.Global) # https://graph.microsoft.com print(NationalClouds.US_GOV) # https://graph.microsoft.us print(NationalClouds.US_DoD) # https://dod-graph.microsoft.us print(NationalClouds.Germany) # https://graph.microsoft.de print(NationalClouds.China) # https://microsoftgraph.chinacloudapi.cn # Build a URL manually url = f"{NationalClouds.Global}/{APIVersion.v1}/me" # -> https://graph.microsoft.com/v1.0/me ``` -------------------------------- ### APIVersion and NationalClouds Enums Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Illustrates the use of APIVersion and NationalClouds strongly-typed enumerations for specifying the Graph API version and national cloud endpoints. These enums can be directly interpolated into URL strings. ```APIDOC ## APIVersion and NationalClouds enums Strongly-typed enumerations that specify which Graph API version and which sovereign cloud endpoint to target. Both are `str` subclasses so they interpolate directly into URL strings. ```python from msgraph_core import APIVersion, NationalClouds print(APIVersion.v1) # v1.0 print(APIVersion.beta) # beta print(NationalClouds.Global) # https://graph.microsoft.com print(NationalClouds.US_GOV) # https://graph.microsoft.us print(NationalClouds.US_DoD) # https://dod-graph.microsoft.us print(NationalClouds.Germany) # https://graph.microsoft.de print(NationalClouds.China) # https://microsoftgraph.chinacloudapi.cn # Build a URL manually url = f"{NationalClouds.Global}/{APIVersion.v1}/me" # -> https://graph.microsoft.com/v1.0/me ``` ``` -------------------------------- ### BatchRequestContentCollection Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Handles sending multiple requests efficiently by batching them. The BatchRequestContentCollection automatically splits requests into manageable batches (up to 20 requests per batch) and the BatchRequestBuilder.post() method sends these batches sequentially, returning a BatchResponseContentCollection. ```APIDOC ## BatchRequestContentCollection Handles scenarios where more than 20 requests need to be sent. Automatically splits items across multiple `BatchRequestContent` objects (each ≤ 20 requests), then `BatchRequestBuilder.post()` sends each batch sequentially and returns a `BatchResponseContentCollection`. ```python import asyncio from kiota_abstractions.request_information import RequestInformation from kiota_abstractions.method import Method from kiota_abstractions.headers_collection import HeadersCollection from msgraph_core.requests import ( BatchRequestBuilder, BatchRequestContentCollection, BatchRequestItem, ) async def main(): collection = BatchRequestContentCollection() # Add 25 requests — automatically split into two batches (20 + 5) for i in range(25): info = RequestInformation() info.http_method = Method.GET info.url = f"/users/{i}" info.headers = HeadersCollection() item = BatchRequestItem(request_information=info) collection.add_batch_request_item(item) print(len(collection.batches)) # 2 # adapter / batch_builder created as in previous example response_collection = await batch_builder.post(collection) for batch_response in response_collection.responses: for request_id, item in batch_response.responses.items(): print(f"{request_id}: HTTP {item.status}") asyncio.run(main()) ``` ``` -------------------------------- ### PageIterator Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Facilitates transparent pagination through OData `@odata.nextLink` responses. It simplifies iterating over all items across multiple pages by accepting the initial response and a RequestAdapter, then invoking a callback for each item. Iteration can be paused by returning `False` from the callback. ```APIDOC ## PageIterator Transparently paginates through OData `@odata.nextLink` responses without manual link tracking. Accepts the first page response and a `RequestAdapter`, then calls a user-supplied callback for every item across all pages. Return `False` from the callback to pause iteration. ```python import asyncio from msgraph_core import PageIterator, BaseGraphRequestAdapter, AzureIdentityAuthenticationProvider from azure.identity.aio import ClientSecretCredential from kiota_abstractions.request_information import RequestInformation from kiota_abstractions.method import Method credential = ClientSecretCredential("TENANT", "CLIENT_ID", "SECRET") adapter = BaseGraphRequestAdapter(AzureIdentityAuthenticationProvider(credential)) async def list_all_users(): # Fetch first page using the adapter request_info = RequestInformation() request_info.http_method = Method.GET request_info.url = "https://graph.microsoft.com/v1.0/users" first_page = await adapter.send_async(request_info, UserCollectionResponse, {{}}) users = [] def callback(user) -> bool: users.append(user.display_name) return True # return False to stop early iterator = PageIterator( response=first_page, request_adapter=adapter, ) await iterator.iterate(callback) print(f"Total users fetched: {len(users)}") print(users[:5]) # Delta link available after full iteration print(iterator.delta_link) asyncio.run(list_all_users()) ``` ``` -------------------------------- ### Batching Multiple Requests with BatchRequestContentCollection Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Use BatchRequestContentCollection to group up to 20 requests into a single batch. The SDK automatically splits larger collections into multiple batches. Requires a configured BatchRequestBuilder. ```python import asyncio from kiota_abstractions.request_information import RequestInformation from kiota_abstractions.method import Method from kiota_abstractions.headers_collection import HeadersCollection from msgraph_core.requests import ( BatchRequestBuilder, BatchRequestContentCollection, BatchRequestItem, ) async def main(): collection = BatchRequestContentCollection() # Add 25 requests — automatically split into two batches (20 + 5) for i in range(25): info = RequestInformation() info.http_method = Method.GET info.url = f"/users/{i}" info.headers = HeadersCollection() item = BatchRequestItem(request_information=info) collection.add_batch_request_item(item) print(len(collection.batches)) # 2 # adapter / batch_builder created as in previous example response_collection = await batch_builder.post(collection) for batch_response in response_collection.responses: for request_id, item in batch_response.responses.items(): print(f"{request_id}: HTTP {item.status}") asyncio.run(main()) ``` -------------------------------- ### Iterating Through Paginated Graph API Responses Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Use PageIterator to automatically handle OData @odata.nextLink pagination. Provide the first page response and a RequestAdapter. A callback function is executed for each item across all pages; returning False pauses iteration. ```python import asyncio from msgraph_core import PageIterator, BaseGraphRequestAdapter, AzureIdentityAuthenticationProvider from azure.identity.aio import ClientSecretCredential from kiota_abstractions.request_information import RequestInformation from kiota_abstractions.method import Method credential = ClientSecretCredential("TENANT", "CLIENT_ID", "SECRET") adapter = BaseGraphRequestAdapter(AzureIdentityAuthenticationProvider(credential)) async def list_all_users(): # Fetch first page using the adapter request_info = RequestInformation() request_info.http_method = Method.GET request_info.url = "https://graph.microsoft.com/v1.0/users" first_page = await adapter.send_async(request_info, UserCollectionResponse, {{}}) users = [] def callback(user) -> bool: users.append(user.display_name) return True # return False to stop early iterator = PageIterator( response=first_page, request_adapter=adapter, ) await iterator.iterate(callback) print(f"Total users fetched: {{len(users)}}") print(users[:5]) # Delta link available after full iteration print(iterator.delta_link) asyncio.run(list_all_users()) ``` -------------------------------- ### Managing Large File Uploads with LargeFileUploadTask Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt LargeFileUploadTask handles resumable, chunked uploads to Graph upload session URLs. It manages chunking (default 5 MB), Content-Range headers, progress callbacks, and resuming expired sessions. ```python import asyncio from io import BytesIO from msgraph_core.tasks import LargeFileUploadTask # upload_session is a Parsable object returned by the Graph SDK # e.g., from drives_item.create_upload_session.post(...) ``` -------------------------------- ### LargeFileUploadTask Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Manages resumable, chunked uploads to a Graph upload session URL. It handles splitting BytesIO streams into chunks, setting Content-Range headers, and supports progress callbacks and resuming expired sessions. ```APIDOC ## LargeFileUploadTask Manages resumable, chunked uploads to a Graph upload session URL (e.g., uploading a file to OneDrive or attaching a large file to a mail item). Automatically splits the `BytesIO` stream into chunks (default 5 MB), sends `Content-Range` headers, and supports progress callbacks and resuming expired sessions. ```python import asyncio from io import BytesIO from msgraph_core.tasks import LargeFileUploadTask # upload_session is a Parsable object returned by the Graph SDK # e.g., from drives_item.create_upload_session.post(...) ``` ``` -------------------------------- ### Retrieving Batch Response Body as a Stream Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Use get_response_stream_by_id to download the raw response body of a specific batch request item as a BytesIO stream. This is useful for binary data or custom deserialization. ```python import asyncio from io import BytesIO async def download_profile_photo(batch_response, photo_request_id: str): stream: BytesIO = batch_response.get_response_stream_by_id(photo_request_id) if stream: with open("profile_photo.jpg", "wb") as f: f.write(stream.read()) print("Photo saved.") else: print("No response body for that request ID.") # Assuming batch_response is a BatchResponseContent already received: asyncio.run(download_profile_photo(batch_response, "photo-request-1")) ``` -------------------------------- ### BatchResponseContent - get_response_stream_by_id Source: https://context7.com/microsoftgraph/msgraph-sdk-python-core/llms.txt Retrieves the raw body of a specific batch response item as a BytesIO stream. This is particularly useful for handling binary responses like file downloads or when custom deserialization is required. ```APIDOC ## BatchResponseContent — get_response_stream_by_id Retrieves the raw body of a batch response item as a `BytesIO` stream, useful when the response is binary (e.g., a file download) or when you want to handle deserialization yourself. ```python import asyncio from io import BytesIO async def download_profile_photo(batch_response, photo_request_id: str): stream: BytesIO = batch_response.get_response_stream_by_id(photo_request_id) if stream: with open("profile_photo.jpg", "wb") as f: f.write(stream.read()) print("Photo saved.") else: print("No response body for that request ID.") # Assuming batch_response is a BatchResponseContent already received: asyncio.run(download_profile_photo(batch_response, "photo-request-1")) ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.