### Retrieve all Themes Source: https://developer.nusii.com/ Examples for fetching a list of available themes. ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/themes" ``` ```bash nusii themes list ``` ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->themes()->list(); ``` -------------------------------- ### Install and Configure Nusii CLI Source: https://developer.nusii.com/ Commands to install the CLI tool and authenticate with an API key. ```bash # Install with Homebrew brew install nusii/tap/nusii # Or install from source go install github.com/nusii/nusii-cli@latest # Login (saves your key to ~/.config/nusii/config.yaml) nusii auth login --api-key YOUR_API_KEY # Check auth status nusii auth status ``` -------------------------------- ### API Response Examples Source: https://developer.nusii.com/ Examples of successful and error responses from the proposal sending endpoint. ```json { "status": "sent", "sent_at": "2026-03-02T17:27:54.000Z", "sender_id": 42, "sender_name": "Michael Koper" } ``` ```json { "error": "You have reached your active proposal limit. Please upgrade your plan to continue sending proposals." } ``` -------------------------------- ### Retrieve all Users Source: https://developer.nusii.com/ Examples for fetching a list of users using various methods. ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/users" ``` ```bash nusii users list ``` ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' Nusii::User.list(page: 1) ``` ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->users()->list(); ``` -------------------------------- ### Get a Specific Template (HTTP) Source: https://developer.nusii.com/ This is an example of an HTTP GET request to retrieve a specific template by its ID. Replace ':id' with the actual template ID. ```http curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/templates/:id" ``` -------------------------------- ### Client creation response JSON Source: https://developer.nusii.com/ This is an example of the JSON response received after successfully creating a client. It includes the client's details and an ID. ```json { "data": { "id": "104", "type": "clients", "attributes": { "email": "john@doe.com", "name": "John", "surname": "Doe", "full_name": "John Doe", "currency": "EUR", "business": "Michael Koper BV", "locale": "en", "pdf_page_size": "A4", "web": "www.michaelkoper.com", "telephone": "1234567890", "address": "Madrid Street 34", "city": "Madrid", "postcode": "28018", "country": "Spain", "state": "Madrid" } } } ``` -------------------------------- ### Get a Specific Client (PHP) Source: https://developer.nusii.com/ Use this PHP code to retrieve a specific client by their ID. Initialize the Nusii client and call the get method with the client ID. ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->clients()->get(100); ``` -------------------------------- ### Create proposal response structure Source: https://developer.nusii.com/ Example JSON response returned upon successful creation of a proposal. ```json { "data": { "id": "126", "type": "proposals", "attributes": { "title": "Webdesign yourwebsite.com", "account_id": 3, "status": "draft", "public_id": "-NqDAkiqpiFLuuw", "prepared_by_id": 3, "client_id": 5, "sender_id": null, "currency": "USD" }, "relationships": { "sections": { "data": [ { "id": "414", "type": "sections" } ] } } } } ``` -------------------------------- ### Proposal response structure Source: https://developer.nusii.com/ Example JSON response returned when retrieving a proposal. ```json { "data": { "id": "126", "type": "proposals", "attributes": { "title": "Webdesign yourwebsite.com", "account_id": 3, "status": "draft", "public_id": "-NqDAkiqpiFLuuw", "prepared_by_id": 3, "client_id": 5, "sender_id": null, "currency": "USD" }, "relationships": { "sections": { "data": [ { "id": "414", "type": "sections" } ] }, "recipients": { "data": [ { "id": "1", "type": "recipients" } ] } } }, "included": [ { "id": "1", "type": "recipients", "attributes": { "id": 1, "name": "Alice", "email": "alice@example.com", "eligible_to_sign": true, "document_sent": false } } ] } ``` -------------------------------- ### GET /api/v2/themes Source: https://developer.nusii.com/ Retrieves a list of all available themes. ```APIDOC ## GET /api/v2/themes ### Description Retrieves all available themes for proposals. ### Method GET ### Endpoint https://app.nusii.com/api/v2/themes ### Response #### Success Response (200) - **id** (String) - The theme identifier. - **name** (String) - The display name of the theme. #### Response Example [ { "id": "clean", "name": "Modern Theme" }, { "id": "classic", "name": "Classic Theme" } ] ``` -------------------------------- ### Get Account Information (PHP) Source: https://developer.nusii.com/ Use this PHP code to fetch your account information. Initialize the Nusii client with your API key and User-Agent. ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->accounts()->me(); ``` -------------------------------- ### Client update response JSON Source: https://developer.nusii.com/ This is an example of the JSON response received after successfully updating a client. It reflects the updated client details. ```json { "data": { "id": "126", "type": "proposals", "attributes": { "email": "support@nusii.com", "name": "Michael", "surname": "Koper", "full_name": "Michael Koper", "currency": "EUR", "business": "Michael Koper BV", "locale": "nl", "pdf_page_size": "A4", "web": "www.michaelkoper.com", "telephone": "1234567890", "address": "Madrid Street 34", "city": "Madrid", "postcode": "28018", "country": "Spain", "state": "Madrid" } } } ``` -------------------------------- ### Get a proposal Source: https://developer.nusii.com/ Retrieve details for a specific proposal by its ID. ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/proposals/:id" ``` ```bash nusii proposals get 100 ``` ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' Nusii::Proposal.get(100) ``` ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->proposals()->get(100); ``` -------------------------------- ### Get All Clients (PHP) Source: https://developer.nusii.com/ This PHP code retrieves a list of all clients. Initialize the Nusii client with your API key and User-Agent, then call the list method. ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->clients()->list(page: 1); ``` -------------------------------- ### Example paginated response structure Source: https://developer.nusii.com/ The meta object provides navigation details for paginated collections. ```json { "data": [ {...}, {...} ], "meta": { "current-page": 2, "next-page": 3, "prev-page": 1, "total-pages": 4, "total-count": 89 } } ``` -------------------------------- ### Get a Section using Nusii PHP SDK Source: https://developer.nusii.com/ This PHP code snippet demonstrates how to fetch a section using the Nusii SDK. Initialize the SDK with your API key. ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->sections()->get(100); ``` -------------------------------- ### Get All Clients (cURL) Source: https://developer.nusii.com/ This cURL command fetches a list of all clients. Ensure your API key and User-Agent are correctly configured in the headers. ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/clients" ``` -------------------------------- ### Get All Proposals using Nusii CLI Source: https://developer.nusii.com/ This command-line interface command lists all proposals. You can filter the results by status using the `--status` flag. ```bash nusii proposals list # Get only accepted proposals nusii proposals list --status accepted # Get only draft proposals nusii proposals list --status draft ``` -------------------------------- ### Get All Templates Source: https://developer.nusii.com/ Retrieve a list of all proposal templates. Optionally, filter to retrieve only public templates. ```APIDOC ## Get all Templates ### Description Retrieves a list of all proposal templates. You can optionally filter to get only public templates. ### Method GET ### Endpoint `https://app.nusii.com/api/v2/templates` ### Parameters #### Query Parameters - **public_templates** (boolean) - Optional - If true, only public templates are returned. ### Request Example (All Templates) ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/templates" ``` ### Request Example (Public Templates Only) ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/templates?public_templates=true" ``` ### Response (Response structure not detailed in the provided text, but typically would be a JSON array of template objects.) ``` -------------------------------- ### Get a Specific Template (CLI) Source: https://developer.nusii.com/ Use the Nusii CLI to fetch a specific template by its ID. Replace '12' with the desired template ID. ```bash nusii templates get 12 ``` -------------------------------- ### GET /api/v2/proposal_activities Source: https://developer.nusii.com/ Retrieves a list of all proposal activities, with optional filtering by proposal or client. ```APIDOC ## GET /api/v2/proposal_activities ### Description Retrieves all proposal activities. ### Method GET ### Endpoint https://app.nusii.com/api/v2/proposal_activities ### Parameters #### Query Parameters - **proposal_id** (integer) - Optional - Only get activities from a specific proposal - **client_id** (integer) - Optional - Only get activities from a specific client ### Response #### Success Response (200) - **data** (array) - List of proposal activity objects - **meta** (object) - Pagination metadata #### Response Example { "data": [ { "id": "259", "type": "proposal_activities", "attributes": { "activity_type": "user_send_proposal", "ip_address": "127.0.0.1", "proposal_title": "Webdevelopment", "proposal_status": "draft" } } ], "meta": { "current_page": 1, "total_pages": 9 } } ``` -------------------------------- ### Get Public Templates Source: https://developer.nusii.com/ Retrieves a list of public templates available in your Nusii account. ```APIDOC ## GET /api/v2/templates ### Description Retrieves a list of templates. By default, it returns templates associated with the authenticated account. Setting `public_templates` to true will return only public templates. ### Method GET ### Endpoint `https://app.nusii.com/api/v2/templates` ### Query Parameters - **public_templates** (boolean) - Optional - If set to true, returns only public templates instead of your account's templates. ### Response #### Success Response (200) - **data** (array) - An array of template objects. - **meta** (object) - Metadata about the pagination. ### Response Example ```json { "data": [ { "id": "12", "type": "templates", "attributes": { "name": "Web Design Proposal", "created_at": "2024-01-15T10:30:00.000Z", "public_template": false } } ], "meta": { "current_page": 1, "next_page": null, "prev_page": null, "total_pages": 1, "total_count": 1 } } ``` ``` -------------------------------- ### Get Account Information (cURL) Source: https://developer.nusii.com/ Use this cURL command to retrieve your account details. Ensure your API key and User-Agent are correctly set in the headers. ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/account/me" ``` -------------------------------- ### Get All Clients (Ruby) Source: https://developer.nusii.com/ Retrieve a list of all clients using the Nusii Ruby gem. Set your API key and User-Agent before calling the list method. ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' Nusii::Client.list(page: 1) ``` -------------------------------- ### Token Response Example Source: https://developer.nusii.com/ A successful response when exchanging an authorization code for tokens includes access token, refresh token, and their expiry. ```json { "access_token": "eyJhbGciOiJIUzI1NiJ9...", "token_type": "Bearer", "expires_in": 86400, "refresh_token": "a1b2c3d4e5f6...", "scope": "read write", "created_at": 1709510400 } ``` -------------------------------- ### Get All Proposals using Nusii Ruby SDK Source: https://developer.nusii.com/ This Ruby code snippet demonstrates how to retrieve proposals using the Nusii Ruby SDK. You can fetch all proposals or filter them by status and archived status. Ensure your API key and user agent are set. ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' # Get all proposals Nusii::Proposal.list(page: 1) # Get only accepted proposals Nusii::Proposal.list(page: 1, status: 'accepted') # Get only draft proposals Nusii::Proposal.list(page: 1, status: 'draft', archived: false) ``` -------------------------------- ### Get All Proposals using Nusii PHP SDK Source: https://developer.nusii.com/ This PHP code snippet shows how to retrieve proposals using the Nusii PHP SDK. You can list all proposals or filter them by status and archived status. Initialize the Nusii object with your API key. ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); // Get all proposals $nusii->proposals()->list(page: 1); // Get only accepted proposals $nusii->proposals()->list(status: 'accepted', page: 1); // Get only draft proposals $nusii->proposals()->list(status: 'draft', archived: false, page: 1); ``` -------------------------------- ### Get All Proposals Source: https://developer.nusii.com/ This endpoint retrieves all proposals. You can filter proposals by status (draft, pending, accepted, rejected, clarification) and by archived status. ```curl curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/proposals" ``` ```curl # Get only accepted proposals curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/proposals?status=accepted" ``` ```curl # Get only draft proposals curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/proposals?status=draft" ``` -------------------------------- ### Get a Specific Client (cURL) Source: https://developer.nusii.com/ Use this cURL command to fetch details for a single client by their ID. Replace ':id' with the actual client ID. ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/clients/:id" ``` -------------------------------- ### Get Account Information (Ruby) Source: https://developer.nusii.com/ This Ruby snippet retrieves your account details using the Nusii gem. Set your API key and User-Agent before making the call. ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' Nusii::Account.me ``` -------------------------------- ### Make Authenticated API Request (Ruby) Source: https://developer.nusii.com/ Construct an HTTP GET request with the Authorization header set to 'Bearer YOUR_ACCESS_TOKEN'. Ensure correct headers are set. ```ruby require 'net/http' require 'json' uri = URI('https://app.nusii.com/api/v2/clients') request = Net::HTTP::Get.new(uri) request['Authorization'] = 'Bearer YOUR_ACCESS_TOKEN' request['Content-Type'] = 'application/json' request['User-Agent'] = 'Your App Name (www.yourapp.com)' response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http| http.request(request) end data = JSON.parse(response.body) ``` -------------------------------- ### Create a client using PHP SDK Source: https://developer.nusii.com/ This PHP code uses the Nusii SDK to create a client. Initialize the SDK with your API key and then call the create method on the clients object. ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->clients()->create([ 'email' => 'john@doe.com', 'name' => 'John', 'surname' => 'Doe', ]); ``` -------------------------------- ### Create a client using Ruby SDK Source: https://developer.nusii.com/ This Ruby code snippet demonstrates how to create a client using the Nusii Ruby SDK. Set your API key and user agent before calling the create method. ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' Nusii::Client.create( email: 'john@doe.com', name: 'John', surname: 'Doe' ) ``` -------------------------------- ### Get a Section using Nusii Ruby Gem Source: https://developer.nusii.com/ Retrieve a section using the Nusii Ruby gem. Set your API key and User-Agent before calling the get method. ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' Nusii::Section.get(100) ``` -------------------------------- ### Create a client using Nusii CLI Source: https://developer.nusii.com/ This command-line interface command creates a new client. It requires the client's email, name, and surname. ```bash nusii clients create --email "john@doe.com" --name "John" --surname "Doe" ``` -------------------------------- ### Create a client using cURL Source: https://developer.nusii.com/ Use this cURL command to create a new client. Ensure you replace YOUR_API_KEY with your actual API key and provide the necessary client details. ```bash curl -X POST \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ -d '{"client": {"email": "john@doe.com", "name": "John", "surname": "Doe", "locale": "en"}}' \ "https://app.nusii.com/api/v2/clients" ``` -------------------------------- ### GET /api/v2/users Source: https://developer.nusii.com/ Retrieves a list of all users in the account. ```APIDOC ## GET /api/v2/users ### Description Retrieves all users associated with the account. ### Method GET ### Endpoint https://app.nusii.com/api/v2/users ### Response #### Success Response (200) - **data** (Array) - List of user objects. - **meta** (Object) - Pagination metadata including current-page, next-page, prev-page, total-pages, and total-count. #### Response Example { "data": [ { "id": "12", "type": "users", "attributes": { "email": "support@nusii.com", "name": "Michael" } } ], "meta": { "current-page": 2, "next-page": 3, "prev-page": 1, "total-pages": 4, "total-count": 52 } } ``` -------------------------------- ### List proposals using Nusii CLI Source: https://developer.nusii.com/ Specify page and per-page parameters to control the collection output. ```bash nusii proposals list --page 2 --per-page 10 ``` -------------------------------- ### GET /api/v2/webhook_endpoints Source: https://developer.nusii.com/ Retrieves a list of all configured webhook endpoints. ```APIDOC ## Get all webhook endpoints ### Description This endpoint retrieves all webhooks endpoints. ### Method GET ### Endpoint `https://app.nusii.com/api/v2/webhook_endpoints` ### Request Example ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/webhook_endpoints" ``` ### Response #### Success Response (200) - **data** (array) - An array of webhook endpoint objects. - **id** (string) - The unique identifier for the webhook endpoint. - **type** (string) - The resource type, always 'webhook_endpoints'. - **attributes** (object) - Contains the webhook endpoint details. - **events** (array) - An array of strings representing the events the webhook is subscribed to. - **target_url** (string) - The URL where the webhook events will be sent. - **meta** (object) - Metadata about the pagination. - **current-page** (integer) - The current page number. - **next-page** (integer) - The next page number. - **prev-page** (integer) - The previous page number. - **total-pages** (integer) - The total number of pages. - **total-count** (integer) - The total number of webhook endpoints. #### Response Example ```json { "data": [ { "id": "26", "type": "webhook_endpoints", "attributes": { "events": [ "proposal_created", "client_updated" ], "target_url": "http://example.com/webhooks" } }, {...} ], "meta": { "current-page": 2, "next-page": 3, "prev-page": 1, "total-pages": 4, "total-count": 89 } } ``` ``` -------------------------------- ### GET /api/v2/line_items Source: https://developer.nusii.com/ Retrieves a paginated list of all line items. ```APIDOC ## GET /api/v2/line_items ### Description This endpoint retrieves all line items. ### Method GET ### Endpoint https://app.nusii.com/api/v2/line_items ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. ### Response #### Success Response (200) - **data** (array) - List of line item objects. - **meta** (object) - Pagination metadata including current_page, next_page, prev_page, total_pages, and total_count. #### Response Example { "data": [ { "id": "154", "type": "line_items", "attributes": { "section_id": 458, "name": "Redesign website", "amount_in_cents": 150000 } } ], "meta": { "current_page": 1, "total_pages": 5 } } ``` -------------------------------- ### Initialize Nusii Client with OAuth Token (PHP) Source: https://developer.nusii.com/ Instantiate the Nusii client using an OAuth access token instead of an API key for authenticated requests. ```php use Nusii\Nusii; // Use an OAuth access token instead of an API key $nusii = new Nusii('YOUR_ACCESS_TOKEN'); $clients = $nusii->clients()->list(); ``` -------------------------------- ### GET /api/v2/webhook_endpoints/:id Source: https://developer.nusii.com/ Retrieves a specific webhook endpoint by its ID. ```APIDOC ## Get a webhook endpoint ### Description This endpoint retrieves a single webhook endpoint. ### Method GET ### Endpoint `https://app.nusii.com/api/v2/webhook_endpoints/:id` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the webhook endpoint to retrieve. ### Request Example ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/webhook_endpoints/:id" ``` ### Response #### Success Response (200) - **data** (object) - The webhook endpoint object. - **id** (string) - The unique identifier for the webhook endpoint. - **type** (string) - The resource type, always 'webhook_endpoints'. - **attributes** (object) - Contains the webhook endpoint details. - **events** (array) - An array of strings representing the events the webhook is subscribed to. - **target_url** (string) - The URL where the webhook events will be sent. #### Response Example ```json { "data": { "id": "33", "type": "webhook_endpoints", "attributes": { "events": [ "proposal_created", "client_created" ], "target_url": "http://example.com/webhooks" } } } ``` ``` -------------------------------- ### GET /api/v2/proposal_activities/:id Source: https://developer.nusii.com/ Retrieves details about a specific proposal activity. ```APIDOC ## GET /api/v2/proposal_activities/:id ### Description Retrieves details about a specific proposal activity. ### Method GET ### Endpoint https://app.nusii.com/api/v2/proposal_activities/:id ### Parameters #### Path Parameters - **id** (String) - Required - The ID of the proposal activity. ### Response #### Success Response (200) - **activty_type** (String) - Type of activity. - **ip_address** (String) - Ip address of the person that does the activity. - **additional_fields** (Hash) - Additional information regarding the activity. - **proposal_attributes** (Object) - Attributes of the associated proposal. - **client_attributes** (Object) - Attributes of the associated client. ``` -------------------------------- ### Get a Specific Template Source: https://developer.nusii.com/ Retrieves the details of a single template by its ID. ```APIDOC ## GET /api/v2/templates/:id ### Description Retrieves a single template by its unique identifier. ### Method GET ### Endpoint `https://app.nusii.com/api/v2/templates/:id` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the template to retrieve. ### Response #### Success Response (200) - **data** (object) - The template object. ### Response Example ```json { "data": { "id": "12", "type": "templates", "attributes": { "name": "Web Design Proposal", "account_id": 3, "created_at": "2024-01-15T10:30:00.000Z", "public_template": false, "dummy_template": false } } } ``` ``` -------------------------------- ### GET /api/v2/clients Source: https://developer.nusii.com/ Retrieves a paginated list of all clients associated with the account. ```APIDOC ## GET /api/v2/clients ### Description This endpoint retrieves all clients. ### Method GET ### Endpoint https://app.nusii.com/api/v2/clients ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. ### Response #### Success Response (200) - **data** (array) - List of client objects. - **meta** (object) - Pagination metadata. #### Response Example { "data": [ { "id": "12", "type": "clients", "attributes": { "email": "support@nusii.com", "name": "Michael", "surname": "Koper", "full_name": "Michael Koper", "currency": "EUR", "business": "Michael Koper BV", "locale": "nl", "pdf_page_size": "A4", "web": "www.michaelkoper.com", "telephone": "1234567890", "address": "Madrid Street 34", "city": "Madrid", "postcode": "28018", "country": "Spain", "state": "Madrid" } } ], "meta": { "current-page": 2, "next-page": 3, "prev-page": 1, "total-pages": 4, "total-count": 52 } } ``` -------------------------------- ### Generate PKCE Code Verifier and Challenge Source: https://developer.nusii.com/ Steps to generate security credentials for the OAuth 2.0 flow. ```bash # Generate a random code verifier (43-128 characters) CODE_VERIFIER=$(openssl rand -base64 96 | tr -d '=+/' | head -c 128) # Create the code challenge (S256) CODE_CHALLENGE=$(echo -n "$CODE_VERIFIER" | openssl dgst -sha256 -binary | openssl base64 | tr '+/' '-_' | tr -d '=') echo "Code Verifier: $CODE_VERIFIER" echo "Code Challenge: $CODE_CHALLENGE" ``` ```bash # The Nusii CLI uses API tokens for authentication. # OAuth is designed for third-party integrations. ``` ```ruby require 'securerandom' require 'digest' require 'base64' code_verifier = SecureRandom.urlsafe_base64(96) code_challenge = Base64.urlsafe_encode64( Digest::SHA256.digest(code_verifier), padding: false ) ``` ```php $codeVerifier = bin2hex(random_bytes(64)); $codeChallenge = rtrim(strtr( base64_encode(hash('sha256', $codeVerifier, true)), '+/', '-_' ), '='); ``` -------------------------------- ### GET /api/v2/account/me Source: https://developer.nusii.com/ Retrieves the personal account data for the authenticated user. ```APIDOC ## GET /api/v2/account/me ### Description This endpoint retrieves your personal account data. ### Method GET ### Endpoint https://app.nusii.com/api/v2/account/me ### Response #### Success Response (200) - **data** (object) - The account information object. #### Response Example { "data": { "id": "3", "type": "accounts", "attributes": { "email": "hello@your_company.com", "name": "Your Company Name", "subdomain": "your_company", "web": "www.your_company.com", "currency": "USD", "pdf_page_size": "A4", "locale": "en", "address": "Your Street Address 50", "address_state": "New York", "postcode": "10022", "city": "New York", "telephone": "1234567890", "default_theme": "clean" } } } ``` -------------------------------- ### CLI Alternative Notes Source: https://developer.nusii.com/ Notes regarding the CLI as an alternative to other integration methods. ```bash # The Nusii CLI is an alternative to using cURL. # Install: brew install nusii/tap/nusii ``` ```bash # The Nusii CLI is an alternative to the Ruby gem. # Install: brew install nusii/tap/nusii ``` ```bash // The Nusii CLI is an alternative to the PHP package. // Install: brew install nusii/tap/nusii ``` -------------------------------- ### List All Sections (CLI) Source: https://developer.nusii.com/ Use the Nusii CLI to list sections. The --proposal-id flag can be used to filter sections belonging to a specific proposal. ```bash nusii sections list --proposal-id 126 ``` -------------------------------- ### GET /api/v2/proposal_activities/{id} Source: https://developer.nusii.com/ Retrieves the details of a single proposal activity by its ID. ```APIDOC ## GET /api/v2/proposal_activities/{id} ### Description Retrieves a single proposal activity. ### Method GET ### Endpoint https://app.nusii.com/api/v2/proposal_activities/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the proposal activity ### Response #### Success Response (200) - **data** (object) - The proposal activity object #### Response Example { "data": { "id": "44", "type": "proposal_activities", "attributes": { "activity_type": "user_send_proposal", "proposal_title": "Design for clientwebsite.com" } } } ``` -------------------------------- ### Get All Sections Source: https://developer.nusii.com/ Retrieves a list of all sections, optionally filtered by proposal or template. ```APIDOC ## GET /api/v2/sections ### Description Retrieves a list of sections. This can be filtered to include sections belonging to a specific proposal or template. ### Method GET ### Endpoint `https://app.nusii.com/api/v2/sections` ### Query Parameters - **proposal_id** (string) - Optional - If set, retrieves all sections of the specified proposal. - **template_id** (string) - Optional - If set, retrieves all sections of the specified template. - **include_line_items** (boolean) - Optional - If set to true, the result will include all the data of the line items in the "included" parameter. ### Response #### Success Response (200) - **data** (array) - An array of section objects. - **meta** (object) - Metadata about the pagination. ### Response Example ```json { "data": [ { "id": "164", "type": "sections", "attributes": { "currency": "GBP", "account_id": 3, "proposal_id": 124, "template_id": null, "title": "Introduction", "name": null, "body": "Lorem ipsum", "position": 0, "reusable": false, "section_type": "cost", "created_at": "2017-03-03T12:23:37.686Z", "updated_at": "2017-03-03T12:23:45.828Z", "page_break": false, "optional": false, "selected": false, "include_total": false, "total_in_cents": 50000, "total_formatted": "£500.00" }, "relationships": { "line_items": { "data": [ { "id": "76", "type": "line_items" } ] } } }, {...} ], "meta": { "current_page": 1, "next_page": 2, "prev_page": null, "total_pages": 2, "total_count": 48 } } ``` ``` -------------------------------- ### List All Templates (PHP) Source: https://developer.nusii.com/ This PHP snippet lists all templates. Ensure your API key is correctly configured. ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->templates()->list(); ``` -------------------------------- ### Webhook Configuration Source: https://developer.nusii.com/ Details on how to configure and handle webhooks for Nusii events. ```APIDOC ## Webhook Configuration ### Description Nusii sends POST requests to your configured URL when specific events occur. The target URL must accept application/json. ### Method POST ### Parameters - **event_name** (String) - The name of the event (e.g., proposal_created, client_updated). - **object** (Hash) - The object associated with the event (e.g., proposal, client). ### Request Example { "event_name": "proposal_created", "proposal": { "id": 30, "title": "Webdevelopment" } } ``` -------------------------------- ### GET /api/v2/proposals/:id Source: https://developer.nusii.com/ Retrieves the details of a single proposal by its unique identifier. ```APIDOC ## GET /api/v2/proposals/:id ### Description This endpoint retrieves a single proposal by its ID. ### Method GET ### Endpoint https://app.nusii.com/api/v2/proposals/:id ### Parameters #### Path Parameters - **id** (ID) - Required - The unique identifier of the proposal. ### Response #### Success Response (200) - **data** (Object) - The proposal object containing attributes and relationships. #### Response Example { "data": { "id": "126", "type": "proposals", "attributes": { "title": "Webdesign yourwebsite.com", "account_id": 3, "status": "draft", "public_id": "-NqDAkiqpiFLuuw", "prepared_by_id": 3, "client_id": 5, "sender_id": null, "currency": "USD" } } } ``` -------------------------------- ### GET /api/v2/clients/:id Source: https://developer.nusii.com/ Retrieves the details of a specific client by their unique identifier. ```APIDOC ## GET /api/v2/clients/:id ### Description This endpoint retrieves a single client. ### Method GET ### Endpoint https://app.nusii.com/api/v2/clients/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the client. ### Response #### Success Response (200) - **data** (object) - The client object. #### Response Example { "data": { "id": "4", "type": "clients", "attributes": { "email": "support@nusii.com", "name": "Michael", "surname": "Koper", "full_name": "Michael Koper", "currency": "EUR", "business": "Michael Koper BV", "locale": "nl", "pdf_page_size": "A4", "web": "www.michaelkoper.com", "telephone": "1234567890", "address": "Madrid Street 34", "city": "Madrid", "postcode": "28018", "country": "Spain", "state": "Madrid" } } } ``` -------------------------------- ### List All Templates (Ruby) Source: https://developer.nusii.com/ This Ruby snippet lists all templates. Set your API key and user agent before making the call. ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' Nusii::Template.list(page: 1) ``` -------------------------------- ### Get a specific webhook endpoint Source: https://developer.nusii.com/ Retrieves details for a single webhook endpoint by its ID. ```curl curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/webhook_endpoints/:id" ``` ```bash nusii webhooks get 100 ``` ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' Nusii::WebhookEndpoint.get(100) ``` ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->webhookEndpoints()->get(100); ``` -------------------------------- ### List Public Templates (CLI) Source: https://developer.nusii.com/ Use this command to retrieve only public templates from your account. Ensure you are authenticated. ```bash nusii templates list --public-templates ``` -------------------------------- ### Get a specific proposal activity Source: https://developer.nusii.com/ Retrieve details for a single proposal activity by its ID. ```bash curl -X GET \ -H 'User-Agent: Your App Name (www.yourapp.com)' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H "Authorization: Token token=YOUR_API_KEY" \ "https://app.nusii.com/api/v2/proposal_activities/44" ``` ```bash nusii activities list --proposal-id 44 ``` ```ruby require 'nusii-ruby' Nusii.api_key = 'YOUR_API_KEY' Nusii.user_agent = 'Your App Name (www.yourapp.com)' activity = Nusii::ProposalActivity.get(44) ``` ```php use Nusii\Nusii; $nusii = new Nusii('YOUR_API_KEY'); $nusii->proposalActivities()->get(44); ``` -------------------------------- ### Create a Section using Nusii CLI Source: https://developer.nusii.com/ Create a section via the Nusii CLI, specifying the proposal ID and title. Other attributes can also be set. ```bash nusii sections create --proposal-id 126 --title "Introduction" ```