Mint picker token
Returns a short-lived provider access token for a browser file picker (file services with a token-based picker only). The refresh token is never returned. An optional body { resource } names the resource the picker requested (used by the OneDrive picker, which requires a SharePoint-audience token); providers whose picker takes a single token ignore it. The OneDrive picker is available only for work or school (OneDrive for Business) accounts.
curl --request POST \
--url https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token \
--header 'Content-Type: application/json' \
--data '
{
"resource": "<string>"
}
'import requests
url = "https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token"
payload = { "resource": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({resource: '<string>'})
};
fetch('https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token"
payload := strings.NewReader("{\n \"resource\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token")
.header("Content-Type", "application/json")
.body("{\n \"resource\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"accessToken": "<string>",
"expiresAt": 123
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}Path Parameters
Body
Body for minting a browser file-picker token.
The OneDrive v8 picker requests a token per resource (it names the resource in
each authenticate command); the caller passes that resource so the server
mints a token scoped to exactly it. Ignored by providers whose picker takes a
single provider token (Google Drive, Box); omit it for those.
Body for minting a browser file-picker token.
The OneDrive v8 picker requests a token per resource (it names the resource in
each authenticate command); the caller passes that resource so the server
mints a token scoped to exactly it. Ignored by providers whose picker takes a
single provider token (Google Drive, Box); omit it for those.
Response
A short-lived provider OAuth access token for a browser file picker.
Carries only the access token and its expiry — never the refresh token, which stays server-side. The token is minted from the connection's stored credentials and is short-lived (the provider's access-token lifetime), so the browser holds a narrow, expiring credential rather than a durable one.
A short-lived provider OAuth access token for a browser file picker.
Carries only the access token and its expiry — never the refresh token, which stays server-side. The token is minted from the connection's stored credentials and is short-lived (the provider's access-token lifetime), so the browser holds a narrow, expiring credential rather than a durable one.
curl --request POST \
--url https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token \
--header 'Content-Type: application/json' \
--data '
{
"resource": "<string>"
}
'import requests
url = "https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token"
payload = { "resource": "<string>" }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({resource: '<string>'})
};
fetch('https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'resource' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token"
payload := strings.NewReader("{\n \"resource\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token")
.header("Content-Type", "application/json")
.body("{\n \"resource\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/workspaces/{workspaceId}/connections/{connectionId}/picker-token")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"accessToken": "<string>",
"expiresAt": 123
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}{
"message": "<string>",
"name": "<string>"
}