eContract Developers
API ReferenceContracts

Set the signature boxes of some signers (draft only)

Replaces the boxes of each listed signer (by signerId or email); others keep theirs. positions: [] puts the signer back on the default box. 409 CONTRACT_NOT_DRAFT once submitted.

PUT
/api/v1/contracts/{id}/signature-positions
AuthorizationBearer <token>

API key cl_live_… or OAuth access token eco_at_… in Authorization: Bearer. Public operations (x-econtract-auth: public) need no credential.

In: header

Path Parameters

id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PUT "https://api.econtract.online/api/v1/contracts/string/signature-positions" \  -H "Content-Type: application/json" \  -d '{    "signers": [      {        "positions": [          {            "page": 2,            "x": 72,            "y": 640          }        ]      }    ]  }'
Empty
Empty
Empty

Code Examples

curl -X PUT "https://api.econtract.online/api/v1/contracts/abc123/signature-positions" \
  -H "Authorization: Bearer cl_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "signers": [
      {
        "signerId": "abc123",
        "email": "[email protected]",
        "positions": [
          {
            "page": 2,
            "x": 72,
            "y": 640,
            "width": 200,
            "height": 60,
            "fileId": "abc123"
          }
        ]
      }
    ]
  }'
const res = await fetch("https://api.econtract.online/api/v1/contracts/abc123/signature-positions", {
  method: "PUT",
  headers: {
    "Authorization": "Bearer cl_live_your_key_here",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
      "signers": [
          {
              "signerId": "abc123",
              "email": "[email protected]",
              "positions": [
                  {
                      "page": 2,
                      "x": 72,
                      "y": 640,
                      "width": 200,
                      "height": 60,
                      "fileId": "abc123"
                  }
              ]
          }
      ]
  }),
}).then(r => r.json());

console.log(res);
import requests

res = requests.put(
    "https://api.econtract.online/api/v1/contracts/abc123/signature-positions",
    headers={"Authorization": "Bearer cl_live_your_key_here"},
    json={
    "signers": [
        {
            "signerId": "abc123",
            "email": "[email protected]",
            "positions": [
                {
                    "page": 2,
                    "x": 72,
                    "y": 640,
                    "width": 200,
                    "height": 60,
                    "fileId": "abc123",
                },
            ],
        },
    ],
},
).json()

print(res)
package main

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

func main() {
    payload, _ := json.Marshal(map[string]interface{}{
        "signers": [{"signerId":"abc123","email":"[email protected]","positions":[{"page":2,"x":72,"y":640,"width":200,"height":60,"fileId":"abc123"}]}],
    })

    req, _ := http.NewRequest("PUT", "https://api.econtract.online/api/v1/contracts/abc123/signature-positions", bytes.NewBuffer(payload))
    req.Header.Set("Authorization", "Bearer cl_live_your_key_here")
    req.Header.Set("Content-Type", "application/json")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()
    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.econtract.online/api/v1/contracts/abc123/signature-positions");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Authorization: Bearer cl_live_your_key_here",
    "Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'signers' => [
        [
            'signerId' => 'abc123',
            'email' => '[email protected]',
            'positions' => [
                [
                    'page' => 2,
                    'x' => 72,
                    'y' => 640,
                    'width' => 200,
                    'height' => 60,
                    'fileId' => 'abc123',
                ],
            ],
        ],
    ],
]));

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

echo $response;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

String jsonBody = "{\"signers\":[{\"signerId\":\"abc123\",\"email\":\"[email protected]\",\"positions\":[{\"page\":2,\"x\":72,\"y\":640,\"width\":200,\"height\":60,\"fileId\":\"abc123\"}]}]}";

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.econtract.online/api/v1/contracts/abc123/signature-positions"))
    .header("Authorization", "Bearer cl_live_your_key_here")
    .header("Content-Type", "application/json")
    .PUT(HttpRequest.BodyPublishers.ofString(jsonBody))
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());

System.out.println(response.body());
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer cl_live_your_key_here");

var json = @"{
  ""signers"": [
    {
      ""signerId"": ""abc123"",
      ""email"": ""[email protected]"",
      ""positions"": [
        {
          ""page"": 2,
          ""x"": 72,
          ""y"": 640,
          ""width"": 200,
          ""height"": 60,
          ""fileId"": ""abc123""
        }
      ]
    }
  ]
}";
var content = new StringContent(json, System.Text.Encoding.UTF8, "application/json");

var response = await client.PutAsync("https://api.econtract.online/api/v1/contracts/abc123/signature-positions", content);
var body = await response.Content.ReadAsStringAsync();

Console.WriteLine(body);