API Instructions

API list

NameURLDescription
Upload fileshttps://api.zan.top/scr/v1/file/get-upload-linkUpload smart contract source code
Create projecthttps://api.zan.top/scr/v1/projectCreate a new project to run review task
Stop projecthttps://api.zan.top/scr/v1/project/{projectId}/stopStop project's review task
Retry projecthttps://api.zan.top/scr/v1/project/{projectId}/retryRetry project's review task
Query statushttps://api.zan.top/scr/v1/project/{projectId}/statusQuery project's review task status
Query report detailhttps://api.zan.top/scr/v1/project/{projectId}/reportQuery project's report details

Basic Usage Instructions

  • You should get an Access Key before you start.
  • Access Key is generated from SCR console by yourself. The following picture shows how to genenrate Access Key.
  • Access Key should be added to the header of your request. Here are some examples about how to use Access Key. You can check API reference for more examples.
curl --request POST \
     --url https://api.zan.top/project \
     --header 'Authorization: Bearer {Your Access Key}' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "projectName": "demo",
  "serviceType": "Express",
  "compilerVersion": "0.8.2",
  "srcForm": "FILE",
  "ifSofiAudit": "false"
}
'
OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"projectName\":\"demo\",\"serviceType\":\"Express\",\"compilerVersion\":\"0.8.2\",\"srcForm\":\"FILE\",\"ifSofiAudit\":\"false\"}");
Request request = new Request.Builder()
  .url("https://api.zan.top/project")
  .post(body)
  .addHeader("accept", "application/json")
  .addHeader("Authorization", "Bearer {Your Access Key}")
  .addHeader("content-type", "application/json")
  .build();

Response response = client.newCall(request).execute();
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.zan.top/project"

	payload := strings.NewReader("{\"projectName\":\"demo\",\"serviceType\":\"Express\",\"compilerVersion\":\"0.8.2\",\"srcForm\":\"FILE\",\"ifSofiAudit\":\"false\"}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("accept", "application/json")
  req.Header.Add("Authorization", "Bearer {Your Access Key}")
	req.Header.Add("content-type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
const options = {
  method: 'POST',
  headers: {
    accept: 'application/json',
    Authorization: 'Bearer {Your Access Key}',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    projectName: 'demo',
    serviceType: 'Express',
    compilerVersion: '0.8.2',
    srcForm: 'FILE',
    ifSofiAudit: 'false'
  })
};

fetch('https://api.zan.top/project', options)
  .then(response => response.json())
  .then(response => console.log(response))
  .catch(err => console.error(err));