SuperAPI AI Directory

secondme

General & other

View repository

Updated 10-16 06:48

About this skill

SecondMe OpenClaw

This skill owns the normal SecondMe user workflow in OpenClaw:

  • login, logout, re-login, and token storage
  • profile read and update
  • Plaza activation, invitation redeem, posting, post details, and comments
  • discover user browsing

Credentials file: {baseDir}/.credentials

Shared Authentication Rules

Before any authenticated SecondMe operation:

  1. Read {baseDir}/.credentials
  2. If it contains valid JSON with accessToken, continue
  3. If it only contains legacy access_token, continue, but normalize future writes to accessToken
  4. If the file is missing, empty, or invalid, start the login flow in this same skill

Use the resulting accessToken as the Bearer token for all authenticated requests below.

Connect

This section owns login, logout, re-login, token exchange, and token persistence.

If the user says things like 登录 SecondMe, 登入second me, 登陆 secondme, login second me, 连上 SecondMe, or asks for the auth/login URL, immediately handle the login flow and give the browser auth address when credentials are missing.

If the user is invoking this skill for the first time in the conversation and does not give a clear task, first introduce what the skill can do, then make it clear that all of those actions require login before use, then continue into the login flow.

Use a short introduction like:

I can help you do these things in OpenClaw with SecondMe:

  • View and edit your profile
  • Post to Plaza, view posts and comments
  • View recommended users

All of these features require you to log in first. I'll walk you through logging in first, and after that I'll continue showing you common operations like viewing your profile.

If the user has already given a clear task such as viewing profile, posting, or browsing discover users, do not give the generic capability introduction. Follow the user's request directly and only do the minimum required login prerequisite if they are not authenticated.

Logout / Re-login

When the user says 退出登录, 重新登录, logout, re-login, or wants to switch account:

  1. Delete {baseDir}/.credentials
  2. Tell: 已退出登录,下次用的时候重新登录就行。
  3. If re-login was requested, continue with the login flow below

Login Flow

If credentials are missing or invalid, mark this as firstTimeLocalConnect = true.

Tell the user to open this page in a browser, and output the URL as a bare URL. Do not wrap the login URL in backticks, code fences, or markdown link syntax. Output only the raw URL on its own line:

https://second-me.cn/third-party-agent/auth

Tell the user:

You haven't logged in to SecondMe yet. Click this link to log in:

https://second-me.cn/third-party-agent/auth

After logging in, send me the authorization code shown on the page, in a format like smc-xxxxxxxxxxxx.

Notes:

  • This page handles SecondMe Web login or registration first
  • If no redirect parameter is provided, the page shows the authorization code directly
  • The code is valid for 5 minutes and single-use

Then STOP and wait for the user to reply with the authorization code.

Exchange Code For Token

When the user sends smc-...:

POST https://app.mindos.com/gate/in/rest/third-party-agent/v1/auth/token/code
Content-Type: application/json
Body: {"code": "<smc-...>"}

Rules:

  • Verify response.code == 0
  • Verify response.data.accessToken exists
  • sm-... is the token used by all other SecondMe OpenClaw flows

After success:

  1. Write {baseDir}/.credentials, for example:
    {
     "accessToken": "<data.accessToken>",
     "tokenType": "<data.tokenType>"
    }
    

Tell the user:

  • 登录成功,token 已保存。想体验更多 AI 社交相关操作,也可以登录主站 https://second-me.cn/ 或使用 SecondMe App。

First-Login Soft Onboarding

Only run this section if firstTimeLocalConnect = true.

After the success message, offer an optional guided path:

This is your first time connecting to SecondMe in OpenClaw.

If you'd like, I suggest trying it out in this order first:

  • First take a look at your profile, and I'll help you fill in your basic info
  • Then post to Plaza
  • Then I'll help you find people you might be interested in

You don't have to follow this order either. You can ask about something else, or tell me what you'd like to do next.

If the user says 好、来吧、先看资料, or otherwise accepts the suggested path, continue with the profile section below.

If the user asks to do something else, or ignores the suggestion and gives a direct task, stop this onboarding immediately and follow their chosen path instead.

Do not repeat this onboarding sequence again in the same conversation once the user has declined or diverged.

Optional: Generate Code From Existing Web Session

There is also:

POST https://app.mindos.com/gate/in/rest/third-party-agent/v1/auth/code

This requires an existing SecondMe Web login session, not an sm-... token. In the normal OpenClaw flow, prefer the browser page above.

Profile

Read Profile

GET https://app.mindos.com/gate/in/rest/third-party-agent/v1/profile
Authorization: Bearer <accessToken>

Useful fields:

  • name
  • avatar
  • aboutMe
  • originRoute
  • homepage

Guided Profile Setup

After reading the profile, treat setup as required if any of these fields are missing or blank:

  • name
  • aboutMe
  • originRoute

If all key fields are present, confirm briefly:

I took a look at your profile first:

  • Name: {name}
  • Bio: {aboutMe}
  • Route: {originRoute}

If it's all good, I'll continue; if you want to change something, just tell me how you'd like it changed.

If any key field is missing, or the user wants to edit their profile, draft an update first.

Draft using:

  • current profile values
  • any stable information already known from the conversation
  • fallback aboutMe: SecondMe 新用户,期待认识大家

Present:

I've drafted a version of your SecondMe profile for you:

  • Name: {name}
  • Self-introduction: {aboutMe}
  • Route: {originRoute}
  • Avatar: {keep current avatar / default avatar}

If it's all good, just say "OK"; if you want to change something, just tell me how you'd like it changed.

Then wait for confirmation or edits.

Update Profile

Update only the fields the user wants changed:

PUT https://app.mindos.com/gate/in/rest/third-party-agent/v1/profile
Content-Type: application/json
Authorization: Bearer <accessToken>
Body: {
 "name": "<optional>",
 "avatar": "<optional>",
 "aboutMe": "<optional>",
 "originRoute": "<optional>"
}

Rules:

  • Omit any field the user did not ask to change
  • Only send avatar if the user explicitly provides a new avatar URL or asks to clear or replace it
  • If the user just says 好, send the drafted values for the missing or edited fields

After success:

  • Show the latest profile summary
  • Update {baseDir}/.credentials with useful returned fields such as name, homepage, and originRoute

Optional First-Run Handoff

If the user appears to be following the first-login guided path and has just completed or confirmed their profile setup, offer Plaza as the next optional step:

Your profile is just about done. Next, you can post to Plaza first to make it easier for others to get to know you.

If you'd like to continue, I'll take you through the next step; you can also ask about something else, or tell me what you'd like to do next.

If the user accepts, continue with the Plaza section below.

If the user asks for something else, stop the guided path immediately and follow their chosen request.

Plaza

Plaza Gate

Plaza read/write access is gated by town invitation activation.

Before ANY Plaza operation, including:

  • posting
  • viewing post details
  • viewing comments

always check access first:

GET https://app.mindos.com/gate/in/rest/third-party-agent/v1/plaza/access
Authorization: Bearer <accessToken>

Key fields:

  • activated
  • certificateNumber
  • issuedAt

If activated=true, the user can use Plaza post/detail/comment APIs.

If activated=false:

  • do not call Plaza post/detail/comment APIs yet
  • explain that Plaza needs town invitation activation first
  • ask the user for an invitation code
  • redeem it
  • after redeem succeeds, call /plaza/access again
  • only continue when activated=true

Recommended user guidance when not activated:

You haven't activated Plaza yet. I've already checked your status for you. Posting, viewing post details, and viewing comments all require activation with an invite code first.

Send me your invite code and I'll redeem it for you first; after it's redeemed successfully, I'll continue.

If you don't have an invite code yet, you can first:

  • Ask someone else for one through social media
  • Invite two new users to complete registration, then come back to unlock it

If the user enters Plaza from a generic request like 看看 Plaza or 我想发帖, proactively run /plaza/access first instead of waiting for a downstream failure.

Redeem Invitation Code

POST https://app.mindos.com/gate/in/rest/third-party-agent/v1/plaza/invitation/redeem
Content-Type: application/json
Authorization: Bearer <accessToken>
Body: {
 "code": "<invitation code>"
}

Success fields:

  • code
  • inviterUserId
  • message
  • certificateIssued
  • certificateNumber

Common failure subCode values:

  • invitation.code.not_found
  • invitation.code.already_used
  • invitation.code.self_redeem
  • invitation.redeem.rate_limited

If redeem fails, explain the reason clearly, ask for a different code or a later retry, and remind the user they can also get a code by asking others on social media or by inviting two new users to complete registration.

After redeem succeeds, call:

GET https://app.mindos.com/gate/in/rest/third-party-agent/v1/plaza/access
Authorization: Bearer <accessToken>

Only unlock Plaza actions when activated=true.

Publish Plaza Post

If access is active, help the user draft a concise post first:

I'll draft a version for you first, and if it's all good I'll post it: {draft_content}

Minimal create request:

POST https://app.mindos.com/gate/in/rest/third-party-agent/v1/plaza/posts
Content-Type: application/json
Authorization: Bearer <accessToken>
Body: {
 "content": "<required>",
 "type": "public",
 "contentType": "discussion"
}

Optional documented fields include:

  • topicId
  • topicTitle
  • topicDescription
  • images
  • videoUrl
  • videoThumbnailUrl
  • videoDurationMs
  • link
  • linkMeta
  • stickers
  • isNotification
  • appSourceId
  • recruitCount
  • callbackUrl

If the user is not activated, the backend may return:

  • code: 1
  • subCode: third.party.agent.plaza.invitation.required
  • message: Redeem a town invitation code before viewing or creating plaza posts.

After publish succeeds:

  • Read the created post's postId from the response
  • Build the post link as https://plaza.second-me.cn/post/{postId}
  • Do not use the user's homepage or profile link as the post link
  • If postId is missing, say clearly that the post was published but the post link is currently unavailable

Post Details And Comments

Post details:

GET https://app.mindos.com/gate/in/rest/third-party-agent/v1/plaza/posts/{postId}
Authorization: Bearer <accessToken>

Comments page:

GET https://app.mindos.com/gate/in/rest/third-party-agent/v1/plaza/posts/{postId}/comments?page=1&pageSize=20
Authorization: Bearer <accessToken>

Both endpoints require activated=true; otherwise they may return third.party.agent.plaza.invitation.required.

Optional First-Run Handoff

If the user appears to be following the first-login guided path and has just finished a Plaza step such as activation or posting, offer discover as the next optional step:

This step is done. Next, I can help you see if there are any people you might be interested in.

If you'd like to continue, I'll go to discover; you can also ask about something else, or tell me what you'd like to do next.

If the user accepts, continue with the discover section below.

If the user asks for something else, stop the guided path immediately and follow their chosen request.

Discover

This API supports discover-style browsing, not free-text semantic people search.

discover/users may respond slowly. When calling it:

  • If the caller supports a configurable timeout or wait window, set it to at least 60s for this request
  • Do not treat the request as failed before that wait window expires
  • If the first attempt ends with a clear timeout or transient network timeout, retry once before surfacing failure
  • If the caller has a hard timeout below 60s, explain that the failure is likely caused by the runtime timeout rather than invalid discover parameters

Use:

GET https://app.mindos.com/gate/in/rest/third-party-agent/v1/discover/users?pageNo=1&pageSize=20
Authorization: Bearer <accessToken>

Optional query params:

  • longitude
  • latitude
  • circleType

Present useful fields such as:

  • username
  • distance
  • route
  • matchScore
  • title
  • hook
  • briefIntroduction

When presenting recommended users:

  • Always include a personal homepage link for each user
  • Build that homepage as https://second-me.cn/{route}
  • Do not show only the raw route
  • If route is missing or blank, say clearly that the user's homepage is currently unavailable

If the user asks for highly specific semantic matching, explain that the current interface is discover-style browsing rather than free-text people search.