Appearance
合同详情
接口信息
- 接口:
/agent-api/user/{user_id}/contract/show/{contract_id} - 请求方式:
GET
路由参数
| 参数 | 类型 | 示例 | 解释 | 必填 |
|---|---|---|---|---|
| user_id | string | 5832d184-dd53-42a0-8ace-0bf8d660f4cc | 用户id | 是 |
| contract_id | string | 1 | 合同的ID | 是 |
请求示例
cURL
curl -X GET "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/contract/show/1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN"Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/contract/show/1", nil)
if err != nil {
panic(err)
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer YOUR_TOKEN")
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}JavaScript
const axios = require('axios');
axios.get('https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/contract/show/1', {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});Java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/contract/show/1"))
.header("Content-Type", "application/json")
.header("Authorization", "Bearer YOUR_TOKEN")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/contract/show/1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"Authorization: Bearer YOUR_TOKEN"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;Python
import requests
url = "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/contract/show/1"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())C++
#include <iostream>
#include <curl/curl.h>
size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
std::cout << (char*)contents;
return size * nmemb;
}
int main() {
CURL* curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
struct curl_slist* headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer YOUR_TOKEN");
curl_easy_setopt(curl, CURLOPT_URL, "https://ai.api.longlonglong.cn/agent-api/user/5832d184-dd53-42a0-8ace-0bf8d660f4cc/contract/show/1");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteCallback);
res = curl_easy_perform(curl);
if(res != CURLE_OK)
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
curl_easy_cleanup(curl);
}
return 0;
}返回参数
json
{
"code": 200,
"status": "success",
"message": "查看合同详情成功",
"data": {
"id": 3,
"name": "合同3号",
"fee": 70000,
"signatory": "签约方3",
"signed_at": "2021-12-16 00:00:00",
"ended_at": "2021-12-16 00:00:00",
"customer_id": "57f2c8c0-c0cc-42b0-b215-95dd9d5b68b5",
"status": 2,
"status_str": "已结清",
"is_overdue": true,
"schedules": [{
"id": "c8105e18-165e-4b86-b67d-b151c911da6a",
"contract_id": 3,
"plan_payment_time": "2021-12-17 11:53:51",
"plan_payment_fee": 70000,
"actual_payment_time": "2021-12-17 11:53:00",
"actual_payment_fee": 70000,
"status": true
}],
"customer": {
"id": "57f2c8c0-c0cc-42b0-b215-95dd9d5b68b5",
"phone": "18569852545",
"name": "我是签约人3号"
}
}
}