AutodeskIntegration-Searchinfolderswithout3-leggedtoken
创始人
2024-11-12 11:30:05
0

在不使用三腿式令牌的情况下,在Autodesk集成中搜索文件夹的解决方案是使用二腿式令牌进行身份验证。

以下是一个Python代码示例,它使用二腿式令牌来搜索Autodesk中的文件夹:

import requests
import json

# Variables
base_url = "https://developer.api.autodesk.com"
client_id = ""
client_secret = ""
folder_id = ""
access_token = ""

# Get 2-legged access token
def get_access_token():
    url = base_url + "/authentication/v1/authenticate"
    scope = "data:read data:write data:create data:search bucket:create bucket:read account:read account:write"

    payload = {
        "client_id": client_id,
        "client_secret": client_secret,
        "grant_type": "client_credentials",
        "scope": scope
    }

    response = requests.post(url, data=payload)
    return json.loads(response.text)["access_token"]

# Search folders
def search_folders():
    headers = {
        "Authorization": "Bearer " + access_token,
        "Content-Type": "application/vnd.api+json"
    }

    url = base_url + "/data/v1/projects/{}/search".format(folder_id)
    payload = {
        "jsonapi": {
          "version": "1.0"
        },
        "filter": {
          "type": "folder",
          "attributes": {
            "name": "myFolder"
          }
        }
    }

    response = requests.post(url, headers=headers, data=json.dumps(payload))
    return json.loads(response.text)

access_token = get_access_token()
search_result = search_folders()
print(search_result)

相关内容

热门资讯

9分钟了解!we-poker软... 9分钟了解!we-poker软件(辅助挂)果然有挂(真实有挂辅助方法)1、全新机制【ai辅助工具激活...
推荐十款!wepoker有什么... 推荐十款!wepoker有什么规律(辅助挂)其实有挂(有挂工具辅助脚本)1、打开软件启动之后找到中间...
传递经验!hhpoker德州作... 传递经验!hhpoker德州作弊(辅助挂)一贯有挂(有挂方式辅助技巧)破解侠是真的助透视。每个模型中...
六分钟了解!aapoker怎么... 六分钟了解!aapoker怎么设置提高好牌几率(辅助挂)竟然真的有挂(有挂总结辅助技巧)一、可以开透...
免费测试版!wejoker开挂... 免费测试版!wejoker开挂(辅助挂)真是真的是有挂(有挂规律辅助插件)是不是有人用挂微扑克wpk...
最新通报!云扑克有透视吗(辅助... 最新通报!云扑克有透视吗(辅助挂)竟然真的是有挂(有挂方针辅助软件)1、模拟器是什么优化,俱乐部是真...
重大通报!aapoker辅助插... 重大通报!aapoker辅助插件工具(辅助挂)其实有挂(新版有挂辅助工具)1、下载好脚本下载之后点击...
揭秘!黑侠破解wepoker(... 揭秘!黑侠破解wepoker(辅助挂)确实是有挂(有挂方法辅助器)1、辅助器安装包、辅助器2、分享自...
查到实测辅助!hhpoker辅... 查到实测辅助!hhpoker辅助器视频(辅助挂)一贯是有挂(发现有挂辅助攻略)1、玩家可以在透视最简...
一分钟秒懂!wepoker辅助... 一分钟秒懂!wepoker辅助真的假的(辅助挂)果然有挂(详细教程辅助插件)一、可以开透视的定义与意...