Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions examples/TemplateEditExample.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.Json;

using Dropbox.Sign.Api;
using Dropbox.Sign.Client;
using Dropbox.Sign.Model;

namespace Dropbox.SignSandbox;

public class TemplateEditExample
{
public static void Run()
{
var config = new Configuration();
config.Username = "YOUR_API_KEY";
// config.AccessToken = "YOUR_ACCESS_TOKEN";

var templateEditRequest = new TemplateEditRequest(
ccRoles: [
"Role 1",
"Role 2",
]
);

try
{
var response = new TemplateApi(config).TemplateEdit(
templateId: "f57db65d3f933b5316d398057a36176831451a35",
templateEditRequest: templateEditRequest
);

Console.WriteLine(response);
}
catch (ApiException e)
{
Console.WriteLine("Exception when calling TemplateApi#TemplateEdit: " + e.Message);
Console.WriteLine("Status Code: " + e.ErrorCode);
Console.WriteLine(e.StackTrace);
}
}
}
48 changes: 48 additions & 0 deletions examples/TemplateEditExample.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.dropbox.sign_sandbox;

import com.dropbox.sign.ApiException;
import com.dropbox.sign.Configuration;
import com.dropbox.sign.api.*;
import com.dropbox.sign.auth.*;
import com.dropbox.sign.JSON;
import com.dropbox.sign.model.*;

import java.io.File;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class TemplateEditExample
{
public static void main(String[] args)
{
var config = Configuration.getDefaultApiClient();
((HttpBasicAuth) config.getAuthentication("api_key")).setUsername("YOUR_API_KEY");
// ((HttpBearerAuth) config.getAuthentication("oauth2")).setBearerToken("YOUR_ACCESS_TOKEN");

var templateEditRequest = new TemplateEditRequest();
templateEditRequest.ccRoles(List.of (
"Role 1",
"Role 2"
));

try
{
var response = new TemplateApi(config).templateEdit(
"f57db65d3f933b5316d398057a36176831451a35", // templateId
templateEditRequest
);

System.out.println(response);
} catch (ApiException e) {
System.err.println("Exception when calling TemplateApi#templateEdit");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
29 changes: 29 additions & 0 deletions examples/TemplateEditExample.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Dropbox\SignSandbox;

require_once __DIR__ . '/../vendor/autoload.php';

use SplFileObject;
use Dropbox;

$config = Dropbox\Sign\Configuration::getDefaultConfiguration();
$config->setUsername("YOUR_API_KEY");
// $config->setAccessToken("YOUR_ACCESS_TOKEN");

$template_edit_request = (new Dropbox\Sign\Model\TemplateEditRequest())
->setCcRoles([
"Role 1",
"Role 2",
]);

try {
$response = (new Dropbox\Sign\Api\TemplateApi(config: $config))->templateEdit(
template_id: "f57db65d3f933b5316d398057a36176831451a35",
template_edit_request: $template_edit_request,
);

print_r($response);
} catch (Dropbox\Sign\ApiException $e) {
echo "Exception when calling TemplateApi#templateEdit: {$e->getMessage()}";
}
28 changes: 28 additions & 0 deletions examples/TemplateEditExample.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import json
from datetime import date, datetime
from pprint import pprint

from dropbox_sign import ApiClient, ApiException, Configuration, api, models

configuration = Configuration(
username="YOUR_API_KEY",
# access_token="YOUR_ACCESS_TOKEN",
)

with ApiClient(configuration) as api_client:
template_edit_request = models.TemplateEditRequest(
cc_roles=[
"Role 1",
"Role 2",
],
)

try:
response = api.TemplateApi(api_client).template_edit(
template_id="f57db65d3f933b5316d398057a36176831451a35",
template_edit_request=template_edit_request,
)

pprint(response)
except ApiException as e:
print("Exception when calling TemplateApi#template_edit: %s\n" % e)
24 changes: 24 additions & 0 deletions examples/TemplateEditExample.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
require "json"
require "dropbox-sign"

Dropbox::Sign.configure do |config|
config.username = "YOUR_API_KEY"
# config.access_token = "YOUR_ACCESS_TOKEN"
end

template_edit_request = Dropbox::Sign::TemplateEditRequest.new
template_edit_request.cc_roles = [
"Role 1",
"Role 2",
]

begin
response = Dropbox::Sign::TemplateApi.new.template_edit(
"f57db65d3f933b5316d398057a36176831451a35", # template_id
template_edit_request,
)

p response
rescue Dropbox::Sign::ApiError => e
puts "Exception when calling TemplateApi#template_edit: #{e}"
end
4 changes: 4 additions & 0 deletions examples/TemplateEditExample.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl -X POST 'https://api.hellosign.com/v3/template/edit/{template_id}' \
-u 'YOUR_API_KEY:' \
-F 'cc_roles[]=Role 1' \
-F 'cc_roles[]=Role 2'
24 changes: 24 additions & 0 deletions examples/TemplateEditExample.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import * as fs from 'fs';
import api from "@dropbox/sign"
import models from "@dropbox/sign"

const apiCaller = new api.TemplateApi();
apiCaller.username = "YOUR_API_KEY";
// apiCaller.accessToken = "YOUR_ACCESS_TOKEN";

const templateEditRequest: models.TemplateEditRequest = {
ccRoles: [
"Role 1",
"Role 2",
],
};

apiCaller.templateEdit(
"f57db65d3f933b5316d398057a36176831451a35", // templateId
templateEditRequest,
).then(response => {
console.log(response.body);
}).catch(error => {
console.log("Exception when calling TemplateApi#templateEdit:");
console.log(error.body);
});
3 changes: 3 additions & 0 deletions examples/json/TemplateEditRequest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cc_roles": ["Role 1", "Role 2"]
}
135 changes: 127 additions & 8 deletions openapi-raw.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6513,6 +6513,118 @@ paths:
seo:
title: '_t__TemplateDelete::SEO::TITLE'
description: '_t__TemplateDelete::SEO::DESCRIPTION'
'/template/edit/{template_id}':
post:
tags:
- Template
summary: '_t__TemplateEdit::SUMMARY'
description: '_t__TemplateEdit::DESCRIPTION'
operationId: templateEdit
parameters:
-
name: template_id
in: path
description: '_t__TemplateEdit::TEMPLATE_ID'
required: true
schema:
type: string
example: f57db65d3f933b5316d398057a36176831451a35
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateEditRequest'
examples:
example:
$ref: '#/components/examples/TemplateEditRequest'
responses:
'200':
description: 'successful operation'
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/X-RateLimit-Limit'
X-RateLimit-Remaining:
$ref: '#/components/headers/X-RateLimit-Remaining'
X-Ratelimit-Reset:
$ref: '#/components/headers/X-Ratelimit-Reset'
content:
application/json:
schema:
$ref: '#/components/schemas/TemplateGetResponse'
examples:
example:
$ref: '#/components/examples/TemplateGetResponse'
4XX:
description: failed_operation
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
examples:
400_example:
$ref: '#/components/examples/Error400Response'
401_example:
$ref: '#/components/examples/Error401Response'
402_example:
$ref: '#/components/examples/Error402Response'
403_example:
$ref: '#/components/examples/Error403Response'
429_example:
$ref: '#/components/examples/Error429Response'
404_example:
$ref: '#/components/examples/Error404Response'
409_example:
$ref: '#/components/examples/Error409Response'
4XX_example:
$ref: '#/components/examples/Error4XXResponse'
security:
-
api_key: []
-
oauth2:
- template_access
x-codeSamples:
-
lang: PHP
label: PHP
source:
$ref: examples/TemplateEditExample.php
-
lang: 'C#'
label: 'C#'
source:
$ref: examples/TemplateEditExample.cs
-
lang: TypeScript
label: TypeScript
source:
$ref: examples/TemplateEditExample.ts
-
lang: Java
label: Java
source:
$ref: examples/TemplateEditExample.java
-
lang: Ruby
label: Ruby
source:
$ref: examples/TemplateEditExample.rb
-
lang: Python
label: Python
source:
$ref: examples/TemplateEditExample.py
-
lang: cURL
label: cURL
source:
$ref: examples/TemplateEditExample.sh
x-meta:
seo:
title: '_t__TemplateEdit::SEO::TITLE'
description: '_t__TemplateEdit::SEO::DESCRIPTION'
x-hideOn: doc
'/template/files/{template_id}':
get:
tags:
Expand Down Expand Up @@ -10179,6 +10291,17 @@ components:
type: boolean
default: false
type: object
TemplateEditRequest:
properties:
cc_roles:
description: '_t__TemplateEdit::CC_ROLES'
type: array
items:
type: string
allow_form_view:
description: '_t__TemplateEdit::ALLOW_FORM_VIEW'
type: boolean
type: object
TemplateRemoveUserRequest:
properties:
account_id:
Expand Down Expand Up @@ -12767,14 +12890,6 @@ components:
$ref: '#/components/schemas/WarningResponse'
type: object
x-internal-class: true
TemplateEditResponse:
required:
- template_id
properties:
template_id:
description: '_t__TemplateResponse::TEMPLATE_ID'
type: string
type: object
TemplateGetResponse:
required:
- template
Expand Down Expand Up @@ -13098,6 +13213,10 @@ components:
summary: 'Form Fields Per Document and Rules Example'
value:
$ref: examples/json/TemplateCreateEmbeddedDraftRequestFormFieldRules.json
TemplateEditRequest:
summary: 'Default Example'
value:
$ref: examples/json/TemplateEditRequest.json
TemplateRemoveUserRequest:
summary: 'Default Example'
value:
Expand Down
Loading