Namespace: microsoft.graph
Important
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Update the software for a Microsoft Teams-enabled device. This API triggers a long-running operation.
Note:
Microsoft is temporarily offering usage of the APIs for managing Microsoft Teams-enabled devices at no charge.
Microsoft expects to charge for the use of some or all of these APIs in the future. Microsoft will provide advanced notice of pricing changes.
For details about the current licensing model, see Licensing and payment requirements.
This API is available in the following national cloud deployments.
Global service |
US Government L4 |
US Government L5 (DOD) |
China operated by 21Vianet |
✅ |
✅ |
✅ |
✅ |
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
Permission type |
Least privileged permissions |
Higher privileged permissions |
Delegated (work or school account) |
TeamworkDevice.ReadWrite.All |
Not available. |
Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
Application |
TeamworkDevice.ReadWrite.All |
Not available. |
HTTP request
POST /teamwork/devices/{teamworkDeviceId}/updateSoftware
Request body
In the request body, supply a JSON representation of the parameters.
The following table shows the parameters that can be used with this action.
Parameter |
Type |
Description |
softwareType |
teamworkSoftwareType |
The software type to update. Valid types are: adminAgent , operatingSystem , teamsClient , firmware , partnerAgent , companyPortal . |
softwareVersion |
String |
Specifies the version of the software available for update. |
Response
If successful, this method returns a 202 Accepted
response code. The response will also contain a Location
header, which contains the location of the teamworkDeviceOperation resource. You can check the status of the software update operation by making a GET request to this location that returns whether the operation is queued
, succeeded
, or failed
.
This method also returns a 409 Conflict
response code if the operation is already in queued state.
Examples
Request
POST https://graph.microsoft.com/beta/teamwork/devices/0f3ce432-e432-0f3c-32e4-3c0f32e43c0f/updateSoftware
Content-Type: application/json
Content-length: 64
{
"softwareType": "teamsClient",
"softwareVersion": "1.0.96.22"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Teamwork.Devices.Item.UpdateSoftware;
using Microsoft.Graph.Beta.Models;
var requestBody = new UpdateSoftwarePostRequestBody
{
SoftwareType = TeamworkSoftwareType.TeamsClient,
SoftwareVersion = "1.0.96.22",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Teamwork.Devices["{teamworkDevice-id}"].UpdateSoftware.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphteamwork "github.com/microsoftgraph/msgraph-beta-sdk-go/teamwork"
graphmodels "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
//other-imports
)
requestBody := graphteamwork.NewUpdateSoftwarePostRequestBody()
softwareType := graphmodels.TEAMSCLIENT_TEAMWORKSOFTWARETYPE
requestBody.SetSoftwareType(&softwareType)
softwareVersion := "1.0.96.22"
requestBody.SetSoftwareVersion(&softwareVersion)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Teamwork().Devices().ByTeamworkDeviceId("teamworkDevice-id").UpdateSoftware().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.teamwork.devices.item.updatesoftware.UpdateSoftwarePostRequestBody updateSoftwarePostRequestBody = new com.microsoft.graph.beta.teamwork.devices.item.updatesoftware.UpdateSoftwarePostRequestBody();
updateSoftwarePostRequestBody.setSoftwareType(TeamworkSoftwareType.TeamsClient);
updateSoftwarePostRequestBody.setSoftwareVersion("1.0.96.22");
graphClient.teamwork().devices().byTeamworkDeviceId("{teamworkDevice-id}").updateSoftware().post(updateSoftwarePostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const updateSoftware = {
softwareType: 'teamsClient',
softwareVersion: '1.0.96.22'
};
await client.api('/teamwork/devices/0f3ce432-e432-0f3c-32e4-3c0f32e43c0f/updateSoftware')
.version('beta')
.post(updateSoftware);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Teamwork\Devices\Item\UpdateSoftware\UpdateSoftwarePostRequestBody;
use Microsoft\Graph\Beta\Generated\Models\TeamworkSoftwareType;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new UpdateSoftwarePostRequestBody();
$requestBody->setSoftwareType(new TeamworkSoftwareType('teamsClient'));
$requestBody->setSoftwareVersion('1.0.96.22');
$graphServiceClient->teamwork()->devices()->byTeamworkDeviceId('teamworkDevice-id')->updateSoftware()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Teams
$params = @{
softwareType = "teamsClient"
softwareVersion = "1.0.96.22"
}
Update-MgBetaTeamworkDeviceSoftware -TeamworkDeviceId $teamworkDeviceId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.teamwork.devices.item.update_software.update_software_post_request_body import UpdateSoftwarePostRequestBody
from msgraph_beta.generated.models.teamwork_software_type import TeamworkSoftwareType
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = UpdateSoftwarePostRequestBody(
software_type = TeamworkSoftwareType.TeamsClient,
software_version = "1.0.96.22",
)
await graph_client.teamwork.devices.by_teamwork_device_id('teamworkDevice-id').update_software.post(request_body)
Response
HTTP/1.1 202 Accepted
Location: /teamwork/devices/0f3ce432-e432-0f3c-32e4-3c0f32e43c0f/operations/119eb06d-0c4b-4fb3-a754-33dd0d6b618c
Content-Type: text/plain
Content-Length: 0