跳转至

用户 - 好友

版本:v1

认证方式:Bearer Token

目录

接口列表

获取用户资料

接口说明

用于他人主页展示

基本信息

  • 接口名称:获取用户资料
  • 请求方式:GET
  • 请求路径:/UserFriends/{appKey}/Profile/{userId}

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
userId - 用户ID
appKey - -

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/Profile/{userId}"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("get", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/Profile/{userId}"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.get(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("get", "{server}/UserFriends/{appKey}/Profile/{userId}", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'get',
    url: '{server}/UserFriends/{appKey}/Profile/{userId}',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/Profile/{userId}";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "get");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.getAsync("{server}/UserFriends/{appKey}/Profile/{userId}");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/Profile/{userId}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/Profile/{userId}", {
    method: "get",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/Profile/{userId}")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("get", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/Profile/{userId}")!
var request = URLRequest(url: url)
request.httpMethod = "get"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

{
    "code": 200          // 状态码,
    "data": {
    "user": {
    "id": "0"          // 用户唯一标识,
    "platform": ""          // 用户所在平台,
    "unionID": ""          // 用户所在平台的唯一标识,
    "nickName": ""          // 昵称,
    "avatar": ""          // 头像,
    "data": ""          // 其他数据,
    "userName": ""          // 用户名,
    "pwd": ""          // 用户密码,
    "email": ""          // 邮箱地址,
    "emailIsValid": false          // 邮箱已验证,
    "phone": ""          // 手机号码,
    "phoneIsValid": false          // 手机号码已验证,
    "relationChain": ""          // 关系链,
    "interestTags": ""          // 兴趣标签,
    "biography": ""          // 个人简介,
    "gender": ""          // 性别,
    "birthday": ""          // 生日,
    "occupation": ""          // 职业,
    "education": ""          // 学历,
    "contact": ""          // 联系方式,
    "languages": ""          // 语言,
    "socialLinks": ""          // 社交网络链接,
    "relationshipStatus": ""          // 婚姻状态,
    "company": ""          // 公司,
    "industry": ""          // 行业,
    "companyPosition": ""          // 行业职位,
    "privateSettings": ""          // 私密设置,
    "isLock": false          // 账户是否锁定,
    "lockUntil": ""          // 账户锁定截止时间,
    "enableUserNameSignIn": false          // 能使用用户名登录,
    "enableEmailSignIn": false          // 能使用邮箱登录,
    "enablePhoneSignIn": false          // 能使用电话号码登录,
    "enableUnionIDSignIn": false          // 能使用联合身份标识登录,
    "enableOAuth": false          // 能使用OAuth认证方式登录,
    "enable2FAAuth": false          // 启用双因素认证登录,
    "createDate": ""          // 创建时间,
    "lastUpdate": ""          // 最后更新时间
},
    "currencies": [
      {
          "id": "0"          // 用户资产的唯一标识符。,
          "userID": "0"          // 与用户资产关联的用户ID。,
          "currencyCode": ""          // 用户资产的货币代码,例如 'USD', 'CNY' 等。,
          "balance": "0"          // 用户的账户余额,表示当前持有的货币数量。
      }
    ],
    "role": "",
    "location": {
    "id": "0"          // 唯一标识,
    "bizCode": ""          // 业务代码,
    "bizID": "0"          // 业务ID,
    "coordinates": {
    "xCoordinate": "0",
    "yCoordinate": "0",
    "srid": "0",
    "isNull": false,
    "value": ""
},
    "locationName": ""          // 地点的名称,
    "locationType": ""          // 地点类型,
    "recipientName": ""          // 收货人姓名,
    "phoneNumber": ""          // 收货人联系电话,
    "email": ""          // 收货人电子邮件,
    "country": ""          // 国家,
    "state": ""          // 州/省,
    "city": ""          // 城市,
    "district": ""          // 区/县,
    "street": ""          // 街道,
    "zipCode": ""          // 邮政编码,
    "address": ""          // 详细的地址信息,
    "mapType": ""          // 地址类型,
    "remark": ""          // 备注,
    "tags": ""          // 标签,
    "enable": false          // 是否启用,
    "showIndex": "0"          // 排序索引,
    "createDate": ""          // 创建时间,
    "lastUpdate": ""          // 最后更新时间
}
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data GetUserProfileResult -
error string 错误信息

添加关注

接口说明

关注指定用户

基本信息

  • 接口名称:添加关注
  • 请求方式:POST
  • 请求路径:/UserFriends/{appKey}/Follower/{userId}

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
userId - 要关注的用户ID
appKey - -

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/Follower/{userId}"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("post", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/Follower/{userId}"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.post(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("post", "{server}/UserFriends/{appKey}/Follower/{userId}", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'post',
    url: '{server}/UserFriends/{appKey}/Follower/{userId}',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/Follower/{userId}";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "post");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.postAsync("{server}/UserFriends/{appKey}/Follower/{userId}");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/Follower/{userId}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/Follower/{userId}", {
    method: "post",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/Follower/{userId}")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("post", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/Follower/{userId}")!
var request = URLRequest(url: url)
request.httpMethod = "post"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

1
2
3
4
5
{
    "code": 200          // 状态码,
    "data": false          // 响应数据,
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data boolean 响应数据
error string 错误信息

取消关注

接口说明

取消关注指定用户

基本信息

  • 接口名称:取消关注
  • 请求方式:DELETE
  • 请求路径:/UserFriends/{appKey}/Follower/{userId}

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
userId - 要取消关注的用户ID
appKey - -

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/Follower/{userId}"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("delete", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/Follower/{userId}"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.delete(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("delete", "{server}/UserFriends/{appKey}/Follower/{userId}", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'delete',
    url: '{server}/UserFriends/{appKey}/Follower/{userId}',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/Follower/{userId}";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "delete");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.deleteAsync("{server}/UserFriends/{appKey}/Follower/{userId}");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/Follower/{userId}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/Follower/{userId}", {
    method: "delete",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/Follower/{userId}")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("delete", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/Follower/{userId}")!
var request = URLRequest(url: url)
request.httpMethod = "delete"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

1
2
3
4
5
{
    "code": 200          // 状态码,
    "data": false          // 响应数据,
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data boolean 响应数据
error string 错误信息

刷新粉丝数据

接口说明

根据粉丝ID更新粉丝信息

基本信息

  • 接口名称:刷新粉丝数据
  • 请求方式:PUT
  • 请求路径:/UserFriends/{appKey}/Follower/{id}

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
id - 粉丝ID
appKey - -
Body 参数
参数名 类型 示例值 参数描述 是否必填
alias string - 别名
closenessScore integer - 亲密度分数
attentionScore integer - 关注度分数
tags string - 标签
status string - 状态
remark string - 备注

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/Follower/{id}"))
            .header("Authorization", "Bearer {your_access_token}")
            .header("Content-Type", "application/json");



        // 创建请求体数据
        Map<String, Object> data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
};
        ObjectMapper mapper = new ObjectMapper();
        String jsonBody = mapper.writeValueAsString(data);
        RequestBody body = RequestBody.create(
            MediaType.parse("application/json"), jsonBody);

        requestBuilder.method("put", HttpRequest.BodyPublishers.ofString(jsonBody));

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/Follower/{id}"
headers = {
    "Authorization": "Bearer {your_access_token}",
    "Content-Type": "application/json"
}


data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
}

response = requests.put(
    url,
    headers=headers,
    json=data
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error


    data := {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
}
    jsonBody, err := json.Marshal(data)
    if err != nil {
        panic(err)
    }

    req, err = http.NewRequest("put", "{server}/UserFriends/{appKey}/Follower/{id}", bytes.NewBuffer(jsonBody))
    if err != nil {
        panic(err)
    }
    req.Header.Set("Content-Type", "application/json")

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');


const data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
};

const config = {
    method: 'put',
    url: '{server}/UserFriends/{appKey}/Follower/{id}',
    headers: {
        'Authorization': 'Bearer {your_access_token}',
        'Content-Type': 'application/json'
    },
    data: data
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/Follower/{id}";
$headers = [
    "Authorization: Bearer {your_access_token}",
    "Content-Type: application/json"
];


$data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
};

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "put");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;


            var data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
};
            var content = new StringContent(
                JsonSerializer.Serialize(data),
                Encoding.UTF8,
                "application/json");
            response = await client.putAsync("{server}/UserFriends/{appKey}/Follower/{id}", content);

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/Follower/{id}")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"
request["Content-Type"] = "application/json"


data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
}
request.set_form_data(data)

response = http.request(request)
puts response.body
const data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
};

fetch("{server}/UserFriends/{appKey}/Follower/{id}", {
    method: "put",
    headers: {
        "Authorization": "Bearer {your_access_token}",
        'Content-Type': 'application/json'
    },
    body: JSON.stringify(data)
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/Follower/{id}")
            .addHeader("Authorization", "Bearer {your_access_token}")
            .addHeader("Content-Type", "application/json");


        JSONObject data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
};
        RequestBody body = RequestBody.create(
            MediaType.parse("application/json"), data.toString());

        requestBuilder.method("put", body);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/Follower/{id}")!
var request = URLRequest(url: url)
request.httpMethod = "put"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")


let data = {
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
}
let jsonData = try? JSONSerialization.data(withJSONObject: data)
request.httpBody = jsonData

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

1
2
3
4
5
{
    "code": 200          // 状态码,
    "data": false          // 响应数据,
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data boolean 响应数据
error string 错误信息

获取粉丝列表

接口说明

根据条件获取我的粉丝列表

基本信息

  • 接口名称:获取粉丝列表
  • 请求方式:GET
  • 请求路径:/UserFriends/{appKey}/Followers

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
appKey - -
Query 参数
参数名 类型 示例值 参数描述 是否必填
tag string - 标签
status string - 状态
targetUserId integer - 指定用户的粉丝
skip integer - 跳过的记录数
take integer 10 获取的记录数

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/Followers"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("get", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/Followers"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.get(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("get", "{server}/UserFriends/{appKey}/Followers", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'get',
    url: '{server}/UserFriends/{appKey}/Followers',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/Followers";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "get");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.getAsync("{server}/UserFriends/{appKey}/Followers");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/Followers")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/Followers", {
    method: "get",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/Followers")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("get", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/Followers")!
var request = URLRequest(url: url)
request.httpMethod = "get"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

{
    "code": 200          // 状态码,
    "data": {
    "totalFollowers": "0",
    "data": [
      {
          "id": "0"          // 用户ID,
          "targetUserID": "0"          // 目标用户ID,
          "alias": ""          // 别名,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像,
          "isMutual": false          // 是否互相关注,
          "closenessScore": "0"          // 亲密度分数,
          "attentionScore": "0"          // 关注度分数,
          "tags": ""          // 标签,
          "status": ""          // 状态,
          "remark": ""          // 备注,
          "createDate": ""          // 创建日期
      }
    ]
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data UserFollowersResult -
error string 错误信息

获取关注列表 / 判断是否关注

接口说明

根据条件获取我的关注列表,或判断是否关注某个用户

基本信息

  • 接口名称:获取关注列表 / 判断是否关注
  • 请求方式:GET
  • 请求路径:/UserFriends/{appKey}/Following

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
appKey - -
Query 参数
参数名 类型 示例值 参数描述 是否必填
tag string - 用于过滤关注列表的标签(可选)。
status string - 用于过滤关注列表的状态(可选)。
targetUserId integer - 指定用户的关注记录,如果不提供则默认为当前用户的关注。
skip integer - 跳过的记录数,用于分页(默认0)。
take integer 10 获取的记录数,用于分页(默认10)。
checkUserId integer - 要判断是否关注的目标用户ID。如果提供此参数,方法将返回一个布尔值,表示当前用户是否关注该目标用户。
onlyIDs boolean - 是否只返回关注用户的ID集合,默认为false(即返回完整的关注用户信息)。

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/Following"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("get", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/Following"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.get(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("get", "{server}/UserFriends/{appKey}/Following", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'get',
    url: '{server}/UserFriends/{appKey}/Following',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/Following";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "get");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.getAsync("{server}/UserFriends/{appKey}/Following");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/Following")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/Following", {
    method: "get",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/Following")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("get", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/Following")!
var request = URLRequest(url: url)
request.httpMethod = "get"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

1
2
3
4
5
{
    "code": 200          // 状态码,
    "data": false          // 响应数据,
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data boolean 响应数据
error string 错误信息

推荐共同关注用户

接口说明

推荐有共同关注的用户

基本信息

  • 接口名称:推荐共同关注用户
  • 请求方式:GET
  • 请求路径:/UserFriends/{appKey}/MutualFollowings

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
appKey - -
Query 参数
参数名 类型 示例值 参数描述 是否必填
skip integer - 跳过的记录数
take integer 10 获取的记录数

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/MutualFollowings"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("get", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/MutualFollowings"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.get(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("get", "{server}/UserFriends/{appKey}/MutualFollowings", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'get',
    url: '{server}/UserFriends/{appKey}/MutualFollowings',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/MutualFollowings";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "get");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.getAsync("{server}/UserFriends/{appKey}/MutualFollowings");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/MutualFollowings")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/MutualFollowings", {
    method: "get",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/MutualFollowings")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("get", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/MutualFollowings")!
var request = URLRequest(url: url)
request.httpMethod = "get"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

{
    "code": 200          // 状态码,
    "data": {
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data UserMutualFollowingsResult -
error string 错误信息

推荐共同粉丝用户

接口说明

推荐有共同粉丝的用户

基本信息

  • 接口名称:推荐共同粉丝用户
  • 请求方式:GET
  • 请求路径:/UserFriends/{appKey}/MutualFollowers

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
appKey - -
Query 参数
参数名 类型 示例值 参数描述 是否必填
skip integer - 跳过的记录数
take integer 10 获取的记录数

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/MutualFollowers"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("get", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/MutualFollowers"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.get(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("get", "{server}/UserFriends/{appKey}/MutualFollowers", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'get',
    url: '{server}/UserFriends/{appKey}/MutualFollowers',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/MutualFollowers";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "get");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.getAsync("{server}/UserFriends/{appKey}/MutualFollowers");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/MutualFollowers")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/MutualFollowers", {
    method: "get",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/MutualFollowers")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("get", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/MutualFollowers")!
var request = URLRequest(url: url)
request.httpMethod = "get"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

{
    "code": 200          // 状态码,
    "data": {
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data UserMutualFollowersResult -
error string 错误信息

推荐相似兴趣用户

接口说明

推荐有共同爱好的用户

基本信息

  • 接口名称:推荐相似兴趣用户
  • 请求方式:GET
  • 请求路径:/UserFriends/{appKey}/CommonInterests

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
appKey - -
Query 参数
参数名 类型 示例值 参数描述 是否必填
tag string - 兴趣标签
skip integer - 跳过的记录数
take integer 10 获取的记录数

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/CommonInterests"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("get", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/CommonInterests"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.get(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("get", "{server}/UserFriends/{appKey}/CommonInterests", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'get',
    url: '{server}/UserFriends/{appKey}/CommonInterests',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/CommonInterests";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "get");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.getAsync("{server}/UserFriends/{appKey}/CommonInterests");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/CommonInterests")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/CommonInterests", {
    method: "get",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/CommonInterests")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("get", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/CommonInterests")!
var request = URLRequest(url: url)
request.httpMethod = "get"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

{
    "code": 200          // 状态码,
    "data": {
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data UserCommonInterestsResult -
error string 错误信息

推荐附近用户

接口说明

根据地理位置坐标和多种筛选条件,查询附近满足条件的用户列表,支持分页和按距离排序。

地理位置查询使用MySQL的ST_Distance_Sphere函数计算球面距离。 注意:longitude为经度(X轴),latitude为纬度(Y轴),参数顺序与常规坐标系一致

基本信息

  • 接口名称:推荐附近用户
  • 请求方式:GET
  • 请求路径:/UserFriends/{appKey}/NearBy

请求参数

Path 参数
参数名 示例值 参数描述 是否必填
appKey - -
Query 参数
参数名 类型 示例值 参数描述 是否必填
longitude number - 当前用户经度坐标(WGS84坐标系)
latitude number - 当前用户纬度坐标(WGS84坐标系)
country string - 国家过滤条件(精确匹配)
state string - 省份过滤条件(精确匹配)
city string - 城市过滤条件(精确匹配)
district string - 区县过滤条件(精确匹配)
gender string - 性别过滤条件(可选值示例:Male/Female/Other)
ageS integer - 年龄起始范围(包含,0表示不限制)
ageE integer - 年龄结束范围(包含,0表示不限制)
tag string - 兴趣标签过滤(支持模糊匹配,如:"运动")
distance integer - 搜索半径(单位:米,0表示不限制距离)
skip integer - 跳过的记录数(分页起始位置,默认0)
take integer 10 获取的记录数(分页大小,默认10,最大100)

示例代码

import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.util.Map;


public class ApiClient {
    public static void main(String[] args) {
        HttpClient client = HttpClient.newHttpClient();

        HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
            .uri(URI.create("{server}/UserFriends/{appKey}/NearBy"))
            .header("Authorization", "Bearer {your_access_token}");


        requestBuilder.method("get", HttpRequest.BodyPublishers.noBody());

        try {
            HttpResponse<String> response = client.send(requestBuilder.build(), HttpResponse.BodyHandlers.ofString());
            System.out.println(response.body());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import requests

url = "{server}/UserFriends/{appKey}/NearBy"
headers = {
    "Authorization": "Bearer {your_access_token}"
}

response = requests.get(
    url,
    headers=headers
)

print(response.json())
package main

import (
    "fmt"
    "io/ioutil"
    "net/http"
    "bytes"
    "encoding/json"
)

func main() {
    client := &http.Client{}

    var req *http.Request
    var err error

    req, err = http.NewRequest("get", "{server}/UserFriends/{appKey}/NearBy", nil)
    if err != nil {
        panic(err)
    }

    req.Header.Add("Authorization", "Bearer {your_access_token}")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    body, err := ioutil.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    fmt.Println(string(body))
}
const axios = require('axios');

const config = {
    method: 'get',
    url: '{server}/UserFriends/{appKey}/NearBy',
    headers: {
        'Authorization': 'Bearer {your_access_token}'
    }
};

axios(config)
    .then(response => {
        console.log(response.data);
    })
    .catch(error => {
        console.error(error);
    });
<?php

$url = "{server}/UserFriends/{appKey}/NearBy";
$headers = [
    "Authorization: Bearer {your_access_token}"
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "get");

$response = curl_exec($ch);
curl_close($ch);

echo $response;
using System;
using System.Net.Http;
using System.Threading.Tasks;
using System.Text;
using System.Text.Json;

class Program
{
    static async Task Main()
    {
        using (var client = new HttpClient())
        {
            client.DefaultRequestHeaders.Add("Authorization", "Bearer {your_access_token}");

            HttpResponseMessage response;
            response = await client.getAsync("{server}/UserFriends/{appKey}/NearBy");

            var content = await response.Content.ReadAsStringAsync();
            Console.WriteLine(content);
        }
    }
}
require 'net/http'
require 'json'

uri = URI("{server}/UserFriends/{appKey}/NearBy")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

request = Net::HTTP::undefined.new(uri)
request["Authorization"] = "Bearer {your_access_token}"

response = http.request(request)
puts response.body
1
2
3
4
5
6
7
8
fetch("{server}/UserFriends/{appKey}/NearBy", {
    method: "get",
    headers: {
        "Authorization": "Bearer {your_access_token}"
    }
})
.then(response => response.json())
.catch(error => console.error(error));
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import org.json.JSONObject;


public class ApiClient {
    private final OkHttpClient client = new OkHttpClient();

    public void makeRequest() {
        Request.Builder requestBuilder = new Request.Builder()
            .url("{server}/UserFriends/{appKey}/NearBy")
            .addHeader("Authorization", "Bearer {your_access_token}");
        requestBuilder.method("get", null);

        try (Response response = client.newCall(requestBuilder.build()).execute()) {
            System.out.println(response.body().string());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
import Foundation

let url = URL(string: "{server}/UserFriends/{appKey}/NearBy")!
var request = URLRequest(url: url)
request.httpMethod = "get"
request.setValue("Bearer {your_access_token}", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")

let task = URLSession.shared.dataTask(with: request) { data, response, error in
    if let data = data {
        if let json = try? JSONSerialization.jsonObject(with: data) {
            print(json)
        }
    }
}
task.resume()

返回结果

{
    "code": 200          // 状态码,
    "data": {
    "total": "0"          // 符合条件的总记录数,
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像,
          "gender": ""          // 性别,
          "age": "0"          // 年龄,
          "interestTags": ""          // 兴趣标签,
          "locationName": ""          // 位置名称,
          "latitude": "0"          // 纬度,
          "longitude": "0"          // 经度,
          "distance": "0"          // 距离,
          "biography": ""          // 个人简介,
          "country": ""          // 国家,
          "state": ""          // 省份,
          "city": ""          // 城市,
          "district": ""          // 区县
      }
    ]          // 当前分页的用户数据列表
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data UserFriendsNearByResult -
error string 错误信息

数据结构

BooleanApiResponse

1
2
3
4
5
{
    "code": 200          // 状态码,
    "data": false          // 响应数据,
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data boolean 响应数据
error string 错误信息

CommonFriendModel

1
2
3
4
5
{
    "userID": "0"          // 用户ID,
    "nickName": ""          // 昵称,
    "avatar": ""          // 头像
}
字段名 类型 描述 是否必填
userID integer 用户ID
nickName string 昵称
avatar string 头像

FollowerModel

{
    "id": "0"          // 用户ID,
    "targetUserID": "0"          // 目标用户ID,
    "alias": ""          // 别名,
    "nickName": ""          // 昵称,
    "avatar": ""          // 头像,
    "isMutual": false          // 是否互相关注,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注,
    "createDate": ""          // 创建日期
}
字段名 类型 描述 是否必填
id integer 用户ID
targetUserID integer 目标用户ID
alias string 别名
nickName string 昵称
avatar string 头像
isMutual boolean 是否互相关注
closenessScore integer 亲密度分数
attentionScore integer 关注度分数
tags string 标签
status string 状态
remark string 备注
createDate string 创建日期

FollowerPutModel

1
2
3
4
5
6
7
8
{
    "alias": ""          // 别名,
    "closenessScore": "0"          // 亲密度分数,
    "attentionScore": "0"          // 关注度分数,
    "tags": ""          // 标签,
    "status": ""          // 状态,
    "remark": ""          // 备注
}
字段名 类型 描述 是否必填
alias string 别名
closenessScore integer 亲密度分数
attentionScore integer 关注度分数
tags string 标签
status string 状态
remark string 备注

GeoLocation

{
    "id": "0"          // 唯一标识,
    "bizCode": ""          // 业务代码,
    "bizID": "0"          // 业务ID,
    "coordinates": {
    "xCoordinate": "0",
    "yCoordinate": "0",
    "srid": "0",
    "isNull": false,
    "value": ""
},
    "locationName": ""          // 地点的名称,
    "locationType": ""          // 地点类型,
    "recipientName": ""          // 收货人姓名,
    "phoneNumber": ""          // 收货人联系电话,
    "email": ""          // 收货人电子邮件,
    "country": ""          // 国家,
    "state": ""          // 州/省,
    "city": ""          // 城市,
    "district": ""          // 区/县,
    "street": ""          // 街道,
    "zipCode": ""          // 邮政编码,
    "address": ""          // 详细的地址信息,
    "mapType": ""          // 地址类型,
    "remark": ""          // 备注,
    "tags": ""          // 标签,
    "enable": false          // 是否启用,
    "showIndex": "0"          // 排序索引,
    "createDate": ""          // 创建时间,
    "lastUpdate": ""          // 最后更新时间
}
字段名 类型 描述 是否必填
id integer 唯一标识
bizCode string 业务代码
bizID integer 业务ID
coordinates - -
locationName string 地点的名称
locationType string 地点类型
recipientName string 收货人姓名
phoneNumber string 收货人联系电话
email string 收货人电子邮件
country string 国家
state string 州/省
city string 城市
district string 区/县
street string 街道
zipCode string 邮政编码
address string 详细的地址信息
mapType string 地址类型
remark string 备注
tags string 标签
enable boolean 是否启用
showIndex integer 排序索引
createDate string 创建时间
lastUpdate string 最后更新时间

GetUserProfileResult

{
    "user": {
    "id": "0"          // 用户唯一标识,
    "platform": ""          // 用户所在平台,
    "unionID": ""          // 用户所在平台的唯一标识,
    "nickName": ""          // 昵称,
    "avatar": ""          // 头像,
    "data": ""          // 其他数据,
    "userName": ""          // 用户名,
    "pwd": ""          // 用户密码,
    "email": ""          // 邮箱地址,
    "emailIsValid": false          // 邮箱已验证,
    "phone": ""          // 手机号码,
    "phoneIsValid": false          // 手机号码已验证,
    "relationChain": ""          // 关系链,
    "interestTags": ""          // 兴趣标签,
    "biography": ""          // 个人简介,
    "gender": ""          // 性别,
    "birthday": ""          // 生日,
    "occupation": ""          // 职业,
    "education": ""          // 学历,
    "contact": ""          // 联系方式,
    "languages": ""          // 语言,
    "socialLinks": ""          // 社交网络链接,
    "relationshipStatus": ""          // 婚姻状态,
    "company": ""          // 公司,
    "industry": ""          // 行业,
    "companyPosition": ""          // 行业职位,
    "privateSettings": ""          // 私密设置,
    "isLock": false          // 账户是否锁定,
    "lockUntil": ""          // 账户锁定截止时间,
    "enableUserNameSignIn": false          // 能使用用户名登录,
    "enableEmailSignIn": false          // 能使用邮箱登录,
    "enablePhoneSignIn": false          // 能使用电话号码登录,
    "enableUnionIDSignIn": false          // 能使用联合身份标识登录,
    "enableOAuth": false          // 能使用OAuth认证方式登录,
    "enable2FAAuth": false          // 启用双因素认证登录,
    "createDate": ""          // 创建时间,
    "lastUpdate": ""          // 最后更新时间
},
    "currencies": [
      {
          "id": "0"          // 用户资产的唯一标识符。,
          "userID": "0"          // 与用户资产关联的用户ID。,
          "currencyCode": ""          // 用户资产的货币代码,例如 'USD', 'CNY' 等。,
          "balance": "0"          // 用户的账户余额,表示当前持有的货币数量。
      }
    ],
    "role": "",
    "location": {
    "id": "0"          // 唯一标识,
    "bizCode": ""          // 业务代码,
    "bizID": "0"          // 业务ID,
    "coordinates": {
    "xCoordinate": "0",
    "yCoordinate": "0",
    "srid": "0",
    "isNull": false,
    "value": ""
},
    "locationName": ""          // 地点的名称,
    "locationType": ""          // 地点类型,
    "recipientName": ""          // 收货人姓名,
    "phoneNumber": ""          // 收货人联系电话,
    "email": ""          // 收货人电子邮件,
    "country": ""          // 国家,
    "state": ""          // 州/省,
    "city": ""          // 城市,
    "district": ""          // 区/县,
    "street": ""          // 街道,
    "zipCode": ""          // 邮政编码,
    "address": ""          // 详细的地址信息,
    "mapType": ""          // 地址类型,
    "remark": ""          // 备注,
    "tags": ""          // 标签,
    "enable": false          // 是否启用,
    "showIndex": "0"          // 排序索引,
    "createDate": ""          // 创建时间,
    "lastUpdate": ""          // 最后更新时间
}
}
字段名 类型 描述 是否必填
user - -
currencies array -
role string -
location - -

GetUserProfileResultApiResponse

{
    "code": 200          // 状态码,
    "data": {
    "user": {
    "id": "0"          // 用户唯一标识,
    "platform": ""          // 用户所在平台,
    "unionID": ""          // 用户所在平台的唯一标识,
    "nickName": ""          // 昵称,
    "avatar": ""          // 头像,
    "data": ""          // 其他数据,
    "userName": ""          // 用户名,
    "pwd": ""          // 用户密码,
    "email": ""          // 邮箱地址,
    "emailIsValid": false          // 邮箱已验证,
    "phone": ""          // 手机号码,
    "phoneIsValid": false          // 手机号码已验证,
    "relationChain": ""          // 关系链,
    "interestTags": ""          // 兴趣标签,
    "biography": ""          // 个人简介,
    "gender": ""          // 性别,
    "birthday": ""          // 生日,
    "occupation": ""          // 职业,
    "education": ""          // 学历,
    "contact": ""          // 联系方式,
    "languages": ""          // 语言,
    "socialLinks": ""          // 社交网络链接,
    "relationshipStatus": ""          // 婚姻状态,
    "company": ""          // 公司,
    "industry": ""          // 行业,
    "companyPosition": ""          // 行业职位,
    "privateSettings": ""          // 私密设置,
    "isLock": false          // 账户是否锁定,
    "lockUntil": ""          // 账户锁定截止时间,
    "enableUserNameSignIn": false          // 能使用用户名登录,
    "enableEmailSignIn": false          // 能使用邮箱登录,
    "enablePhoneSignIn": false          // 能使用电话号码登录,
    "enableUnionIDSignIn": false          // 能使用联合身份标识登录,
    "enableOAuth": false          // 能使用OAuth认证方式登录,
    "enable2FAAuth": false          // 启用双因素认证登录,
    "createDate": ""          // 创建时间,
    "lastUpdate": ""          // 最后更新时间
},
    "currencies": [
      {
          "id": "0"          // 用户资产的唯一标识符。,
          "userID": "0"          // 与用户资产关联的用户ID。,
          "currencyCode": ""          // 用户资产的货币代码,例如 'USD', 'CNY' 等。,
          "balance": "0"          // 用户的账户余额,表示当前持有的货币数量。
      }
    ],
    "role": "",
    "location": {
    "id": "0"          // 唯一标识,
    "bizCode": ""          // 业务代码,
    "bizID": "0"          // 业务ID,
    "coordinates": {
    "xCoordinate": "0",
    "yCoordinate": "0",
    "srid": "0",
    "isNull": false,
    "value": ""
},
    "locationName": ""          // 地点的名称,
    "locationType": ""          // 地点类型,
    "recipientName": ""          // 收货人姓名,
    "phoneNumber": ""          // 收货人联系电话,
    "email": ""          // 收货人电子邮件,
    "country": ""          // 国家,
    "state": ""          // 州/省,
    "city": ""          // 城市,
    "district": ""          // 区/县,
    "street": ""          // 街道,
    "zipCode": ""          // 邮政编码,
    "address": ""          // 详细的地址信息,
    "mapType": ""          // 地址类型,
    "remark": ""          // 备注,
    "tags": ""          // 标签,
    "enable": false          // 是否启用,
    "showIndex": "0"          // 排序索引,
    "createDate": ""          // 创建时间,
    "lastUpdate": ""          // 最后更新时间
}
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data - -
error string 错误信息

MySqlGeometry

1
2
3
4
5
6
7
{
    "xCoordinate": "0",
    "yCoordinate": "0",
    "srid": "0",
    "isNull": false,
    "value": ""
}
字段名 类型 描述 是否必填
xCoordinate number -
yCoordinate number -
srid integer -
isNull boolean -
value string -

RecommendFriend

{
    "userID": "0"          // 用户ID,
    "nickName": ""          // 昵称,
    "avatar": ""          // 头像,
    "gender": ""          // 性别,
    "age": "0"          // 年龄,
    "interestTags": ""          // 兴趣标签,
    "locationName": ""          // 位置名称,
    "latitude": "0"          // 纬度,
    "longitude": "0"          // 经度,
    "distance": "0"          // 距离,
    "biography": ""          // 个人简介,
    "country": ""          // 国家,
    "state": ""          // 省份,
    "city": ""          // 城市,
    "district": ""          // 区县
}
字段名 类型 描述 是否必填
userID integer 用户ID
nickName string 昵称
avatar string 头像
gender string 性别
age integer 年龄
interestTags string 兴趣标签
locationName string 位置名称
latitude number 纬度
longitude number 经度
distance integer 距离
biography string 个人简介
country string 国家
state string 省份
city string 城市
district string 区县

User

{
    "id": "0"          // 用户唯一标识,
    "platform": ""          // 用户所在平台,
    "unionID": ""          // 用户所在平台的唯一标识,
    "nickName": ""          // 昵称,
    "avatar": ""          // 头像,
    "data": ""          // 其他数据,
    "userName": ""          // 用户名,
    "pwd": ""          // 用户密码,
    "email": ""          // 邮箱地址,
    "emailIsValid": false          // 邮箱已验证,
    "phone": ""          // 手机号码,
    "phoneIsValid": false          // 手机号码已验证,
    "relationChain": ""          // 关系链,
    "interestTags": ""          // 兴趣标签,
    "biography": ""          // 个人简介,
    "gender": ""          // 性别,
    "birthday": ""          // 生日,
    "occupation": ""          // 职业,
    "education": ""          // 学历,
    "contact": ""          // 联系方式,
    "languages": ""          // 语言,
    "socialLinks": ""          // 社交网络链接,
    "relationshipStatus": ""          // 婚姻状态,
    "company": ""          // 公司,
    "industry": ""          // 行业,
    "companyPosition": ""          // 行业职位,
    "privateSettings": ""          // 私密设置,
    "isLock": false          // 账户是否锁定,
    "lockUntil": ""          // 账户锁定截止时间,
    "enableUserNameSignIn": false          // 能使用用户名登录,
    "enableEmailSignIn": false          // 能使用邮箱登录,
    "enablePhoneSignIn": false          // 能使用电话号码登录,
    "enableUnionIDSignIn": false          // 能使用联合身份标识登录,
    "enableOAuth": false          // 能使用OAuth认证方式登录,
    "enable2FAAuth": false          // 启用双因素认证登录,
    "createDate": ""          // 创建时间,
    "lastUpdate": ""          // 最后更新时间
}
字段名 类型 描述 是否必填
id integer 用户唯一标识
platform string 用户所在平台
unionID string 用户所在平台的唯一标识
nickName string 昵称
avatar string 头像
data string 其他数据
userName string 用户名
pwd string 用户密码
email string 邮箱地址
emailIsValid boolean 邮箱已验证
phone string 手机号码
phoneIsValid boolean 手机号码已验证
relationChain string 关系链
interestTags string 兴趣标签
biography string 个人简介
gender string 性别
birthday string 生日
occupation string 职业
education string 学历
contact string 联系方式
languages string 语言
socialLinks string 社交网络链接
relationshipStatus string 婚姻状态
company string 公司
industry string 行业
companyPosition string 行业职位
privateSettings string 私密设置
isLock boolean 账户是否锁定
lockUntil string 账户锁定截止时间
enableUserNameSignIn boolean 能使用用户名登录
enableEmailSignIn boolean 能使用邮箱登录
enablePhoneSignIn boolean 能使用电话号码登录
enableUnionIDSignIn boolean 能使用联合身份标识登录
enableOAuth boolean 能使用OAuth认证方式登录
enable2FAAuth boolean 启用双因素认证登录
createDate string 创建时间
lastUpdate string 最后更新时间

UserCommonInterestsResult

{
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
}
字段名 类型 描述 是否必填
totalFollowers integer -
data array -

UserCommonInterestsResultApiResponse

{
    "code": 200          // 状态码,
    "data": {
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data - -
error string 错误信息

UserCurrency

1
2
3
4
5
6
{
    "id": "0"          // 用户资产的唯一标识符。,
    "userID": "0"          // 与用户资产关联的用户ID。,
    "currencyCode": ""          // 用户资产的货币代码,例如 'USD', 'CNY' 等。,
    "balance": "0"          // 用户的账户余额,表示当前持有的货币数量。
}
字段名 类型 描述 是否必填
id integer 用户资产的唯一标识符。
userID integer 与用户资产关联的用户ID。
currencyCode string 用户资产的货币代码,例如 'USD', 'CNY' 等。
balance integer 用户的账户余额,表示当前持有的货币数量。

UserFollowersResult

{
    "totalFollowers": "0",
    "data": [
      {
          "id": "0"          // 用户ID,
          "targetUserID": "0"          // 目标用户ID,
          "alias": ""          // 别名,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像,
          "isMutual": false          // 是否互相关注,
          "closenessScore": "0"          // 亲密度分数,
          "attentionScore": "0"          // 关注度分数,
          "tags": ""          // 标签,
          "status": ""          // 状态,
          "remark": ""          // 备注,
          "createDate": ""          // 创建日期
      }
    ]
}
字段名 类型 描述 是否必填
totalFollowers integer -
data array -

UserFollowersResultApiResponse

{
    "code": 200          // 状态码,
    "data": {
    "totalFollowers": "0",
    "data": [
      {
          "id": "0"          // 用户ID,
          "targetUserID": "0"          // 目标用户ID,
          "alias": ""          // 别名,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像,
          "isMutual": false          // 是否互相关注,
          "closenessScore": "0"          // 亲密度分数,
          "attentionScore": "0"          // 关注度分数,
          "tags": ""          // 标签,
          "status": ""          // 状态,
          "remark": ""          // 备注,
          "createDate": ""          // 创建日期
      }
    ]
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data - -
error string 错误信息

UserFriendsNearByResult

{
    "total": "0"          // 符合条件的总记录数,
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像,
          "gender": ""          // 性别,
          "age": "0"          // 年龄,
          "interestTags": ""          // 兴趣标签,
          "locationName": ""          // 位置名称,
          "latitude": "0"          // 纬度,
          "longitude": "0"          // 经度,
          "distance": "0"          // 距离,
          "biography": ""          // 个人简介,
          "country": ""          // 国家,
          "state": ""          // 省份,
          "city": ""          // 城市,
          "district": ""          // 区县
      }
    ]          // 当前分页的用户数据列表
}
字段名 类型 描述 是否必填
total integer 符合条件的总记录数
data array 当前分页的用户数据列表

UserFriendsNearByResultApiResponse

{
    "code": 200          // 状态码,
    "data": {
    "total": "0"          // 符合条件的总记录数,
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像,
          "gender": ""          // 性别,
          "age": "0"          // 年龄,
          "interestTags": ""          // 兴趣标签,
          "locationName": ""          // 位置名称,
          "latitude": "0"          // 纬度,
          "longitude": "0"          // 经度,
          "distance": "0"          // 距离,
          "biography": ""          // 个人简介,
          "country": ""          // 国家,
          "state": ""          // 省份,
          "city": ""          // 城市,
          "district": ""          // 区县
      }
    ]          // 当前分页的用户数据列表
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data - -
error string 错误信息

UserMutualFollowersResult

{
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
}
字段名 类型 描述 是否必填
totalFollowers integer -
data array -

UserMutualFollowersResultApiResponse

{
    "code": 200          // 状态码,
    "data": {
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data - -
error string 错误信息

UserMutualFollowingsResult

{
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
}
字段名 类型 描述 是否必填
totalFollowers integer -
data array -

UserMutualFollowingsResultApiResponse

{
    "code": 200          // 状态码,
    "data": {
    "totalFollowers": "0",
    "data": [
      {
          "userID": "0"          // 用户ID,
          "nickName": ""          // 昵称,
          "avatar": ""          // 头像
      }
    ]
},
    "error": ""          // 错误信息
}
字段名 类型 描述 是否必填
code integer 状态码
data - -
error string 错误信息

通用错误码

错误码 说明
200 成功