Skip to content

Basic Command Word

checkHeaders

php
\FresnsCmdWord::plugin('Fresns')->checkHeaders();
Return Example
json
{
    "code": 0,
    "message": "ok",
    "data": {
        "appId": "qe12345",
        "platformId": 4,
        "version": "2.0.0",
        "deviceInfo": "",
        "langTag": "zh-Hans",
        "timezone": "+8",
        "contentFormat": "",
        "aid": "6a3bb3bc",
        "aidToken": "uoX1hk6SHUgB2MFGJwNx38dem9DA7Vsz",
        "uid": 782622,
        "uidToken": "PqBpwPLJgfd1sH0X5JffYFGxTSc8RW7c",
        "signature": "d5db4371a0c2d7e17009dea8d53ecf15a7ec07b9",
        "timestamp": 1626426833
    }
}

verifySign

php
\FresnsCmdWord::plugin('Fresns')->verifySign($wordBody);
Parameter NameTypeRequiredDescription
platformIdNumberrequiredPlatform ID (Key value of the platforms key name in the configuration table)
versionStringrequiredSemantic version number
appIdStringrequiredApp ID
timestampNumberrequiredSignature generation time (current Unix timestamp, accurate to seconds or milliseconds)
signatureStringrequiredRequest signature
aidStringoptionalAccount parameter (Account main table accounts->aid field)
aidTokenStringoptionalAccount identity credential
uidNumberoptionalUser parameter (User main table users->uid field)
uidTokenStringoptionalUser identity credential
verifyTypeNumberoptionalVerify session_keys->type, default to 1 if empty
verifyFskeyStringoptionalDedicated for type 3, verify associated plugin

verifyUrlAuthorization

php
\FresnsCmdWord::plugin('Fresns')->verifyUrlAuthorization($wordBody);
Parameter NameTypeRequiredDescription
urlAuthorizationStringrequiredReference: Make URL Authorization
accountLoginBooleanoptionalWhether a login is required, if left empty, no login is required
userLoginBooleanoptionalWhether a user login is required, if left empty, no login is required
Return Example
json
{
    "code": 0,
    "message": "ok",
    "data": {
        "appId": "qe12345",
        "platformId": 4,
        "version": "2.0.0",
        "deviceInfo": "",
        "langTag": "zh-Hans",
        "timezone": "+8",
        "contentFormat": "",
        "aid": "6a3bb3bc",
        "aidToken": "uoX1hk6SHUgB2MFGJwNx38dem9DA7Vsz",
        "uid": 782622,
        "uidToken": "PqBpwPLJgfd1sH0X5JffYFGxTSc8RW7c",
        "signature": "d5db4371a0c2d7e17009dea8d53ecf15a7ec07b9",
        "timestamp": 1626426833
    }
}

uploadSessionLog

php
\FresnsCmdWord::plugin('Fresns')->uploadSessionLog($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequiredLog Type
platformIdNumberrequiredPlatform ID (Key value of the platforms key name in the configuration table)
versionStringrequiredSemantic version number, e.g., 2.0.0
appIdStringoptionalSecret App ID
langTagStringoptionalLanguage Tag
fskeyStringoptionalPlugin Fskey
aidStringoptionalAccount
uidNumberoptionalUser
objectNameStringrequiredFunction model name or interface path
For example, model name App\Models\Post
For example, interface path: /api/v2/account/login
objectActionStringrequiredAction description, custom input content
objectResultNumberrequired1. Unknown or in progress / 2. Success / 3. Failure
objectOrderIdStringoptionalFor example, if it is a publishing action, it represents the ID of the published content
Plugin behavior, this ID can query the corresponding plugin-side related information
deviceInfoObjectoptionalInteraction device information
deviceTokenStringoptionalInteraction device Token
For example, iOS Device Token or Android Device Token
Can be used for push notifications
moreJsonObjectoptionalOther custom information

sendCode

php
\FresnsCmdWord::plugin('Fresns')->sendCode($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequiredType: 1. Email verification code / 2. SMS verification code
accountStringrequiredAccount (email or phone number)
countryCodeNumberoptionalInternational area code (phone number specific)
templateIdNumberrequiredCode Template ID
langTagStringrequiredLanguage Tag

checkCode

php
\FresnsCmdWord::plugin('Fresns')->checkCode($wordBody);
Parameter NameTypeRequiredDescription
typeNumberrequiredType: 1. Email verification code / 2. SMS verification code
accountStringrequiredAccount (email or phone number)
countryCodeNumberoptionalInternational area code (phone number specific)
verifyCodeStringrequiredVerify Code
templateIdNumberrequiredCode Template ID

ipInfo

php
\FresnsCmdWord::plugin('Fresns')->ipInfo($wordBody);
Parameter NameTypeRequiredDescription
ipv4StringrequiredIPv4 and IPv6 support

Released under the Apache-2.0 License