Twenty CRM
Interact with your self-hosted Twenty instance via REST and GraphQL.
Config
Create config/twenty.env (example at config/twenty.env.example):
- -
TWENTY_BASE_URL (e.g. https://crm.example.com or http://localhost:3000) - INLINECODE5 (Bearer token)
Scripts load this file automatically.
Commands
Low-level helpers
- - REST GET: INLINECODE6
- REST POST: INLINECODE7
- REST PATCH: INLINECODE8
- REST DELETE: INLINECODE9
Common objects (examples)
- - Create company: INLINECODE11
- Find companies by name: INLINECODE12
Notes
- - Twenty supports both REST (
/rest/...) and GraphQL (/graphql). - Object names/endpoints can differ depending on your workspace metadata and Twenty version.
- Auth tokens can be short-lived depending on your setup; refresh if you get
401.
Twenty CRM
通过REST和GraphQL与您的自托管Twenty实例进行交互。
配置
创建config/twenty.env文件(示例见config/twenty.env.example):
- - TWENTYBASEURL(例如https://crm.example.com或http://localhost:3000)
- TWENTYAPIKEY(Bearer令牌)
脚本会自动加载此文件。
命令
底层辅助工具
- - REST GET:skills/twenty-crm/scripts/twenty-rest-get.sh /companies filter={name:{ilike:%acme%}}&limit=10
- REST POST:skills/twenty-crm/scripts/twenty-rest-post.sh /companies {name:Acme}
- REST PATCH:skills/twenty-crm/scripts/twenty-rest-patch.sh /companies/ {employees:550}
- REST DELETE:skills/twenty-crm/scripts/twenty-rest-delete.sh /companies/
- - GraphQL:skills/twenty-crm/scripts/twenty-graphql.sh query { companies(limit: 5) { totalCount } }
常用对象(示例)
- - 创建公司:skills/twenty-crm/scripts/twenty-create-company.sh Acme acme.com 500
- 按名称查找公司:skills/twenty-crm/scripts/twenty-find-companies.sh acme 10
注意事项
- - Twenty同时支持REST(/rest/...)和GraphQL(/graphql)。
- 对象名称/端点可能因工作区元数据和Twenty版本而异。
- 认证令牌的有效期可能较短,具体取决于您的配置;如果收到401错误,请刷新令牌。