Files
docuseal/app/views/api_settings/index.html.erb
T

106 lines
5.1 KiB
Plaintext
Raw Normal View History

2023-08-05 12:44:09 +03:00
<div class="flex flex-wrap space-y-4 md:flex-nowrap md:space-y-0 md:space-x-10">
<%= render 'shared/settings_nav' %>
<div class="flex-grow">
<h1 class="text-4xl font-bold mb-4">API</h1>
<div class="card bg-base-200">
<div class="card-body p-6">
<label for="api_key" class="text-sm font-semibold">X-Auth-Token</label>
2023-08-05 15:25:16 +03:00
<div class="flex flex-row space-x-4">
2023-08-06 17:33:08 +03:00
<input id="api_key" type="text" value="<%= current_user.access_token.token %>" class="input font-mono input-bordered w-full" autocomplete="off" readonly>
<%= render 'shared/clipboard_copy', icon: 'copy', text: current_user.access_token.token, class: 'base-button', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy', copied_title: 'Copied' %>
2023-08-05 12:44:09 +03:00
</div>
</div>
</div>
<div class="space-y-4 mt-4">
<div class="collapse collapse-plus bg-base-200 px-1">
<input type="checkbox">
<div class="collapse-title text-xl font-medium">
<div>
Request signature, single submitter
</div>
<div class="mt-1">
<div class="badge badge-warning badge-lg">POST</div>
<div class="badge badge-primary badge-lg"><%= api_submissions_path %></div>
</div>
</div>
<div class="collapse-content" style="display: inherit">
<div class="mockup-code overflow-hidden">
2023-08-05 15:25:16 +03:00
<% text = capture do %>curl --location '<%= api_submissions_url %>' \
2023-08-06 17:33:08 +03:00
--header 'X-Auth-Token: <%= current_user.access_token.token %>' \
2023-08-05 12:44:09 +03:00
--data-raw '{
2023-08-05 15:25:16 +03:00
"template_id": <%= current_account.templates.last&.id || 1 %>,
2023-08-05 12:44:09 +03:00
"emails": "<%= current_user.email.sub('@', '+test@') %>, <%= current_user.email.sub('@', '+test2@') %>"
2023-08-05 15:25:16 +03:00
}'<% end.to_str %>
<span class="top-0 right-0 absolute">
<%= render 'shared/clipboard_copy', icon: 'copy', text:, class: 'btn btn-ghost text-white', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy', copied_title: 'Copied' %>
</span>
<pre data-prefix="$"><code class="overflow-hidden w-full"><%= text %></code></pre>
2023-08-05 12:44:09 +03:00
</div>
</div>
</div>
<div class="collapse collapse-plus bg-base-200 px-1">
<input type="checkbox">
<div class="collapse-title text-xl font-medium">
<div>
2023-08-11 18:32:33 +03:00
Request signature, multiple submitters with default values
2023-08-05 12:44:09 +03:00
</div>
<div class="mt-1">
<div class="badge badge-warning badge-lg">POST</div>
<div class="badge badge-primary badge-lg"><%= api_submissions_path %></div>
</div>
</div>
<div class="collapse-content" style="display: inherit">
<div class="mockup-code overflow-hidden">
2023-08-05 15:25:16 +03:00
<% text = capture do %>curl --location '<%= api_submissions_url %>' \
2023-08-06 17:33:08 +03:00
--header 'X-Auth-Token: <%= current_user.access_token.token %>' \
2023-08-05 12:44:09 +03:00
--data-raw '{
2023-08-05 15:25:16 +03:00
"template_id": <%= current_account.templates.last&.id || 1 %>,
2023-08-05 12:44:09 +03:00
"submission": [
{
"submitters": [
2023-08-11 18:32:33 +03:00
{
2023-09-03 14:05:31 +03:00
"name": "John Doe",
"role": "<%= current_account.templates.last ? current_account.templates.last.submitters.first['name'] : 'First Submitter' %>",
2023-08-11 18:32:33 +03:00
"email": "<%= current_user.email.sub('@', '+test@') %>",
"values": {
"Form Text Field Name": "Default Value"
}
},
2023-08-05 12:44:09 +03:00
{ "name": "Second Submitter", "email": "<%= current_user.email.sub('@', '+test2@') %>" }
]
}
]
2023-08-05 15:25:16 +03:00
}'<% end.to_str %>
<span class="top-0 right-0 absolute">
<%= render 'shared/clipboard_copy', icon: 'copy', text:, class: 'btn btn-ghost text-white', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy', copied_title: 'Copied' %>
</span>
<pre data-prefix="$"><code class="overflow-hidden w-full"><%= text %></code></pre>
2023-08-05 12:44:09 +03:00
</div>
</div>
</div>
2023-08-11 18:32:33 +03:00
<div class="collapse collapse-plus bg-base-200 px-1">
<input type="checkbox">
<div class="collapse-title text-xl font-medium">
<div>
Template details
</div>
<div class="mt-1">
<div class="badge badge-info badge-lg">GET</div>
<div class="badge badge-primary badge-lg"><%= api_template_path(':id') %></div>
</div>
</div>
<div class="collapse-content" style="display: inherit">
<div class="mockup-code overflow-hidden">
<% text = capture do %>curl '<%= api_template_url(current_account.templates&.last || 1) %>' \
2023-08-11 18:32:33 +03:00
--header 'X-Auth-Token: <%= current_user.access_token.token %>'<% end.to_str %>
<span class="top-0 right-0 absolute">
<%= render 'shared/clipboard_copy', icon: 'copy', text:, class: 'btn btn-ghost text-white', icon_class: 'w-6 h-6 text-white', copy_title: 'Copy', copied_title: 'Copied' %>
</span>
<pre data-prefix="$"><code class="overflow-hidden w-full"><%= text %></code></pre>
</div>
</div>
</div>
2023-08-05 12:44:09 +03:00
</div>
</div>
</div>