jahid/autodesk-forge
Composer 安装命令:
composer require jahid/autodesk-forge
包简介
this is a package for autodesk forge process management
README 文档
README
Overview
This PHP SDK enables you to easily integrate the Forge REST APIs into your application, including OAuth, Data Management, Model Derivative, and Design Automation.
Requirements
- PHP version 8.1 and above.
- A registered app on the Forge Developer portal.
Installation
Composer
To install the bindings via Composer, run:
composer require jahid/autodesk-forge
Vendor publish
Run command
php artisan vendor:publish
Then publish the AutodeskForgeService service.
Add those variable in .env
AUTODESK_FORGE_CLIENT_ID= AUTODESK_FORGE_CLIENT_SECRET= AUTODESK_PROJECT= #need only for Autodesk 360 AUTODESK_SCOPE= #i.e. "bucket:read,bucket:create,bucket:delete,data:create,account:read,account:write,data:write,data:read,code:all"
Tutorial
Follow this tutorial to see a step-by-step authentication guide, and examples of how to use the Forge APIs.
Create an App
Create an app on the Forge Developer portal. Note the client ID and client secret.
Authentication
This SDK comes with an OAuth 2.0 client that allows you to retrieve 2-legged tokens. The tutorial uses 2-legged tokens for calling different Data Management endpoints.
2-Legged Token
This type of token is given directly to the application.
To get a 2-legged token run the following code. There have an optional parameter (bool $isSetSession) also. If you send true then it save the token in session. If you do not send any parameter or send false parameter then it not store the token in session.
(new AutodeskForge\service\AutodeskForgeService)->getToken()
Note: If you set the token then you can also access to token as like this Session::get('autodeskForgeToken'). But we recommend to use (new AutodeskForge\service\AutodeskForgeService)->getToken(true) this process;
API Documentation
You can get the full documentation for the API on the Developer Portal
Documentation for API Endpoints
All URIs are relative to https://developer.api.autodesk.com. For example, the createActivity URI is 'https://developer.api.autodesk.com/autocad.io/us-east/v2/Activities'.
| Method | Parameter | Description |
|---|---|---|
| getToken | optional $isSetSession => bool |
Get authentication token. If you send $isSetSession parameter value true, then it store the token in session. So application not sent api request for every time for token. |
| createBucket | optional $policyKey => string (persistent, transient, temporary)optional $bucketKey => string |
Create a bucket |
| getBuckets | get bucket list | |
| getBucketDetails | bucketKey | get bucket details |
| deleteBucket | bucketKey | delete bucket details |
| upload | path=> string, fileName => string | upload file in s3 bucket. here path is file source path and fileName is which name is use in s3 |
| translate | urn => string, fileName => string, type => string (default value svf2), views => array (default value ["2d", "3d"]), compressedUrn => bool (default value false), region => string (default value us) |
You find the objectId in upload file response, this is urn. You can translate file for 2d views only, as well 3d views only also you can translate both 2d & 3d ... |
| encodeUrn | $urn=> string | this method is used for encode urn |
| getManifest (check translate status) | $encodedUrn=> string (objectId is urn, you must encode the urn) |
this method is used for check translate status |
| deleteManifest (delete translated file) | $encodedUrn=> string (objectId is urn, you must encode the urn) |
this method is used for delete translated file |
| checkTranslateStatus (check translate status) | $encodedUrn=> string (objectId is urn, you must encode the urn) |
this method is used for check translate status |
Future Feature
- Upload file in Autodesk 3600
Support
Please open an issue on GitHub
License
Create CRUD operation for Laravel application under the MIT license.
jahid/autodesk-forge 适用场景与选型建议
jahid/autodesk-forge 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 05 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 jahid/autodesk-forge 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 jahid/autodesk-forge 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-05-05