Communitygithub.com

jeremylongshore/tons-of-skills-marketplace

配置 AppFolio Stack API 的 OAuth 2.0 身份认证。用于设置物业管理 API 访问、注册为 AppFolio Stack 合作伙伴,或配置客户端凭证以进行 API 调用。

tons-of-skills-marketplace 是什么?

该技能详细说明了如何为 AppFolio Stack API 配置 HTTP Basic Auth 身份认证。它指导用户从 AppFolio 合作伙伴计划获取客户端 ID 和客户端密钥,然后使用 TypeScript 创建一个带有基本认证的 REST 客户端。该技能支持 Node.js 18+ 和 Python 3.10+ 环境,并通过一个安全的临时文件方法进行连接验证,避免将凭据暴露在命令行中。它提供了常用 API 端点的参考表(如属性、单元、租户等),并包含了常见错误(如 401、403、404)的故障排除指南。该技能非常适合开发者在首次设置或调试 AppFolio API 集成时使用。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/HEAD/plugins/saas-packs/appfolio-pack/skills/appfolio-install-auth

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

AppFolio 安装与认证

概览

配置 AppFolio Stack API 身份认证。AppFolio 使用 HTTP 基本认证,需要客户端 ID 和客户端密钥,这些通过其 Stack 合作伙伴计划提供。没有公开的 npm SDK — 建议使用直接的 REST API 调用。

前提条件

  • AppFolio Stack 合作伙伴账户(appfolio.com/stack)
  • 来自 AppFolio 的客户端 ID 和客户端密钥
  • Node.js 18+ 或 Python 3.10+

操作说明

步骤 1:获取 API 凭据

# AppFolio Stack API 凭据来自合作伙伴计划
# 1. 在 appfolio.com/stack/become-a-partner 申请
# 2. 完成集成审核
# 3. 接收提供商颁发的基础 URL 和凭据交付说明。
# 将值存储在批准的密钥管理器中。如果本地开发需要非密钥模板,请仅提交此模板:
cat > .env.example << 'ENVFILE'
APPFOLIO_CLIENT_ID=
APPFOLIO_CLIENT_SECRET=
APPFOLIO_BASE_URL=
ENVFILE

# .env 文件保持忽略状态;只能通过批准的本地密钥流程填充。

步骤 2:创建 API 客户端

// src/appfolio-client.ts
import axios, { AxiosInstance } from 'axios';

class AppFolioClient {
  private api: AxiosInstance;

  constructor() {
    this.api = axios.create({
      baseURL: process.env.APPFOLIO_BASE_URL,
      auth: {
        username: process.env.APPFOLIO_CLIENT_ID!,
        password: process.env.APPFOLIO_CLIENT_SECRET!,
      },
      headers: { 'Content-Type': 'application/json' },
      timeout: 30000,
    });
  }

  async verifyConnection(): Promise<boolean> {
    try {
      const response = await this.api.get('/properties');
      console.log(`已连接!找到 ${response.data.length} 个属性`);
      return true;
    } catch (error: any) {
      console.error(`连接失败:${error.response?.status} ${error.message}`);
      return false;
    }
  }

  get http(): AxiosInstance { return this.api; }
}

export { AppFolioClient };

步骤 3:验证连接

# 快速、安全的诊断,避免将基本认证参数放在 argv 中。
NETRC_FILE="$(mktemp)"
trap 'rm -f "$NETRC_FILE"' EXIT
chmod 600 "$NETRC_FILE"
APPFOLIO_HOST="${APPFOLIO_BASE_URL#https://}"
APPFOLIO_HOST="${APPFOLIO_HOST%%/*}"
printf 'machine %s login %s password %s\n' "$APPFOLIO_HOST" \
  "$APPFOLIO_CLIENT_ID" "$APPFOLIO_CLIENT_SECRET" > "$NETRC_FILE"
curl -s -o /dev/null -w '%{http_code}\n' --netrc-file "$NETRC_FILE" \
  "${APPFOLIO_BASE_URL}/properties"

API 端点

资源端点方法
属性/api/v1/propertiesGET
单元/api/v1/unitsGET
租户/api/v1/tenantsGET
租约/api/v1/leasesGET, POST
账单/api/v1/billsGET, POST
供应商/api/v1/vendorsGET
业主/api/v1/ownersGET
报表/api/v1/reportsGET

输出

  • 通过已批准的密钥边界注入提供商颁发的凭据
  • 带基本认证的 TypeScript REST 客户端
  • 针对已批准的安全读取端点的连接结果(已脱敏)

示例

对于首次认证演练,通过本地密钥机制注入沙箱凭据和提供商颁发的基础 URL,然后向一个已批准的合成属性页面发起一次只读请求。仅记录状态码和客户端配置结论;不要在共享日志中打印属性负载、客户端 ID、密钥或完整的主机/路径。如果合同、基础 URL、密钥绑定或状态结果未经验证,请在执行任何写入工作流之前停止,并让凭据所有者修正配置。

错误处理

错误原因解决方法
401 Unauthorized无效凭据向 AppFolio 验证客户端 ID/密钥
403 Forbidden不是 Stack 合作伙伴完成合作伙伴申请
404 Not Found基础 URL 错误使用 your-company.appfolio.com 格式
超时网络问题检查防火墙是否允许 HTTPS 连接到 appfolio.com

参考资料

后续步骤

继续执行 appfolio-hello-world 以进行您的首次属性查询。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

jeremylongshore/tons-of-skills-marketplace

Use when asked to structure a landing page for positioning, plan a conversion-optimized page layout, or design a launch page. Examples: "landing page for product launch", "conversion-optimized layout for SaaS

jeremylongshore/tons-of-skills-marketplace

Use when asked to design growth-optimized landing pages, activation funnel layouts, or experiment-friendly page structures. Examples: "growth-optimized landing", "activation funnel layout", "A/B testable page

jeremylongshore/tons-of-skills-marketplace

Use when asked to structure a landing page, design page layout for conversion, or plan landing page information architecture. Examples: "landing page structure for SaaS", "conversion-optimized layout

jeremylongshore/tons-of-skills-marketplace

Generate polished demo videos from a single prompt. Use when the user asks to create a demo video, product walkthrough, feature showcase, or animated presentation. Trigger with "make a demo video", "create a product video", "demo walkthrough", or "feature showcase video".

jeremylongshore/tons-of-skills-marketplace

Track cryptocurrency portfolio with real-time valuations, allocation analysis, and P&L tracking. Use when checking portfolio value, viewing holdings breakdown, analyzing allocations, or exporting portfolio data. Trigger with phrases like "show my portfolio", "check crypto holdings", "portfolio allocation", "track my crypto", or "export portfolio".

jeremylongshore/tons-of-skills-marketplace

Runs the full release workflow for the current project. Commits any uncommitted changes, pushes to remote, creates and merges a PR if on a feature branch, determines the next semver version from conventional commits, creates an annotated git tag and GitHub release with generated notes, cleans up merged branches, and returns to a clean main. Use when the user says promote, ship, release, commit and push, tag and release, or get back to main.

jeremylongshore/tons-of-skills-marketplace

Agent skill at plugins/productivity/content-multiplier/skills/channel-formats/SKILL.md

jeremylongshore/tons-of-skills-marketplace

Operate an evidence-backed editorial queue, balance topic and format coverage, schedule approved drafts, and reconcile backlog state with the publishing system. Use when choosing or scheduling the next blog work. Trigger with "show the editorial calendar" or "pick the next topic".

jeremylongshore/tons-of-skills-marketplace

Configure CI/CD pipeline for AppFolio property management integrations. Trigger: "appfolio CI".

jeremylongshore/tons-of-skills-marketplace

Diagnose and fix common AppFolio API integration errors. Trigger: "appfolio error".

jeremylongshore/tons-of-skills-marketplace

Build property management dashboard with AppFolio API data. Trigger: "appfolio property dashboard".

jeremylongshore/tons-of-skills-marketplace

Automate tenant management and lease operations with AppFolio. Trigger: "appfolio tenant management".

jeremylongshore/tons-of-skills-marketplace

Collect AppFolio API debug evidence for support tickets. Trigger: "appfolio debug".

jeremylongshore/tons-of-skills-marketplace

Deploy AppFolio integration service to cloud infrastructure. Trigger: "deploy appfolio".

jeremylongshore/tons-of-skills-marketplace

Query AppFolio properties, units, and tenants via REST API. Trigger: "appfolio hello world".

jeremylongshore/tons-of-skills-marketplace

Set up local development for AppFolio property management API integration. Trigger: "appfolio local dev".

jeremylongshore/tons-of-skills-marketplace

Production readiness checklist for AppFolio integrations. Trigger: "appfolio production checklist".

jeremylongshore/tons-of-skills-marketplace

Handle AppFolio API rate limits with throttling and backoff. Trigger: "appfolio rate limit".

jeremylongshore/tons-of-skills-marketplace

Reference architecture for AppFolio property management integration. Trigger: "appfolio architecture".

jeremylongshore/tons-of-skills-marketplace

Apply production-ready patterns for AppFolio REST API integration. Trigger: "appfolio patterns".

相关技能