DealMakerAPI 0.105.1 → 0.105.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +11 -10
- data/docs/CampaignApi.md +74 -0
- data/docs/V1EntitiesDealsProgressPageSummaryItem.md +3 -1
- data/docs/V1EntitiesTtwCampaignResponse.md +32 -0
- data/lib/DealMakerAPI/api/campaign_api.rb +85 -0
- data/lib/DealMakerAPI/models/v1_entities_deals_progress_page_summary_item.rb +14 -4
- data/lib/DealMakerAPI/models/v1_entities_ttw_campaign_response.rb +286 -0
- data/lib/DealMakerAPI/version.rb +1 -1
- data/lib/DealMakerAPI.rb +2 -0
- data/spec/api/campaign_api_spec.rb +47 -0
- data/spec/models/v1_entities_deals_progress_page_summary_item_spec.rb +6 -0
- data/spec/models/v1_entities_ttw_campaign_response_spec.rb +78 -0
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfce5a36c0021156e83fc5594ed50afa9d5f09bb73cef5a36ce66fd5dc702dd5
|
4
|
+
data.tar.gz: '08939fa95330e5ed3e07ca326980fe3339c01a77af306fb18713a8382d6c15a6'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b87fcaa97c59351fb8309fe99db5e304b7ab718f05ee7e990d7f3ed05d88e90b2225367273a649f26cbf5719e4dd324bdbe1bc64e4a9a93087f754a5aa8cb89d
|
7
|
+
data.tar.gz: d7cb45fffb902d6127ad6ee85638450c97e324f258e6fcdc700959c3a45fc9411b96de1909715591a3dea884e09829dbd7e242fa69edd7cc8eb6218b72a36761
|
data/README.md
CHANGED
@@ -338,7 +338,7 @@ Given the high number of updates our platform performs on any investor, we’ve
|
|
338
338
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
339
339
|
|
340
340
|
- API version: 1.75.0
|
341
|
-
- Package version: 0.105.
|
341
|
+
- Package version: 0.105.3
|
342
342
|
- Generator version: 7.7.0-SNAPSHOT
|
343
343
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
344
344
|
|
@@ -355,16 +355,16 @@ gem build DealMakerAPI.gemspec
|
|
355
355
|
Then either install the gem locally:
|
356
356
|
|
357
357
|
```shell
|
358
|
-
gem install ./DealMakerAPI-0.105.
|
358
|
+
gem install ./DealMakerAPI-0.105.3.gem
|
359
359
|
```
|
360
360
|
|
361
|
-
(for development, run `gem install --dev ./DealMakerAPI-0.105.
|
361
|
+
(for development, run `gem install --dev ./DealMakerAPI-0.105.3.gem` to install the development dependencies)
|
362
362
|
|
363
363
|
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
364
364
|
|
365
365
|
Finally add this to the Gemfile:
|
366
366
|
|
367
|
-
gem 'DealMakerAPI', '~> 0.105.
|
367
|
+
gem 'DealMakerAPI', '~> 0.105.3'
|
368
368
|
|
369
369
|
### Install from Git
|
370
370
|
|
@@ -391,16 +391,15 @@ require 'DealMakerAPI'
|
|
391
391
|
# Setup authorization
|
392
392
|
DealMakerAPI.configure do |config|end
|
393
393
|
|
394
|
-
api_instance = DealMakerAPI::
|
395
|
-
id = 56 # Integer |
|
396
|
-
create_bulk_upload_request = DealMakerAPI::CreateBulkUploadRequest.new({file_identifier: 'file_identifier_example', document_type: 'document_type_example', upload_name: 'upload_name_example', send_notification: false, notification_message: 'notification_message_example', json_notification_message: 3.56}) # CreateBulkUploadRequest |
|
394
|
+
api_instance = DealMakerAPI::CampaignApi.new
|
395
|
+
id = 56 # Integer |
|
397
396
|
|
398
397
|
begin
|
399
|
-
#
|
400
|
-
result = api_instance.
|
398
|
+
#Gets a TTW campaign for a given company
|
399
|
+
result = api_instance.get_ttw_campaign(id)
|
401
400
|
p result
|
402
401
|
rescue DealMakerAPI::ApiError => e
|
403
|
-
puts "Exception when calling
|
402
|
+
puts "Exception when calling CampaignApi->get_ttw_campaign: #{e}"
|
404
403
|
end
|
405
404
|
|
406
405
|
```
|
@@ -411,6 +410,7 @@ All URIs are relative to *http://api.dealmaker.tech*
|
|
411
410
|
|
412
411
|
Class | Method | HTTP request | Description
|
413
412
|
------------ | ------------- | ------------- | -------------
|
413
|
+
*DealMakerAPI::CampaignApi* | [**get_ttw_campaign**](docs/CampaignApi.md#get_ttw_campaign) | **GET** /ttw/campaigns/{id} | Gets a TTW campaign for a given company
|
414
414
|
*DealMakerAPI::CompanyApi* | [**create_bulk_upload**](docs/CompanyApi.md#create_bulk_upload) | **POST** /companies/{id}/documents/bulk_uploads | Create bulk upload record
|
415
415
|
*DealMakerAPI::CompanyApi* | [**create_bulk_upload_detail**](docs/CompanyApi.md#create_bulk_upload_detail) | **POST** /companies/{company_id}/documents/bulk_uploads/{bulk_upload_id}/details | Create a BulkUploadDetail class record
|
416
416
|
*DealMakerAPI::CompanyApi* | [**create_company**](docs/CompanyApi.md#create_company) | **POST** /companies | Create new company
|
@@ -637,6 +637,7 @@ Class | Method | HTTP request | Description
|
|
637
637
|
- [DealMakerAPI::V1EntitiesShareholdersTags](docs/V1EntitiesShareholdersTags.md)
|
638
638
|
- [DealMakerAPI::V1EntitiesState](docs/V1EntitiesState.md)
|
639
639
|
- [DealMakerAPI::V1EntitiesSubscriptionAgreement](docs/V1EntitiesSubscriptionAgreement.md)
|
640
|
+
- [DealMakerAPI::V1EntitiesTtwCampaignResponse](docs/V1EntitiesTtwCampaignResponse.md)
|
640
641
|
- [DealMakerAPI::V1EntitiesUser](docs/V1EntitiesUser.md)
|
641
642
|
- [DealMakerAPI::V1EntitiesUsersBinding](docs/V1EntitiesUsersBinding.md)
|
642
643
|
- [DealMakerAPI::V1EntitiesUsersFactor](docs/V1EntitiesUsersFactor.md)
|
data/docs/CampaignApi.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# DealMakerAPI::CampaignApi
|
2
|
+
|
3
|
+
All URIs are relative to *http://api.dealmaker.tech*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**get_ttw_campaign**](CampaignApi.md#get_ttw_campaign) | **GET** /ttw/campaigns/{id} | Gets a TTW campaign for a given company |
|
8
|
+
|
9
|
+
|
10
|
+
## get_ttw_campaign
|
11
|
+
|
12
|
+
> <V1EntitiesTtwCampaignResponse> get_ttw_campaign(id)
|
13
|
+
|
14
|
+
Gets a TTW campaign for a given company
|
15
|
+
|
16
|
+
Gets a TTW campaign for a given company
|
17
|
+
|
18
|
+
### Examples
|
19
|
+
|
20
|
+
```ruby
|
21
|
+
require 'time'
|
22
|
+
require 'DealMakerAPI'
|
23
|
+
# setup authorization
|
24
|
+
DealMakerAPI.configure do |config|end
|
25
|
+
|
26
|
+
api_instance = DealMakerAPI::CampaignApi.new
|
27
|
+
id = 56 # Integer |
|
28
|
+
|
29
|
+
begin
|
30
|
+
# Gets a TTW campaign for a given company
|
31
|
+
result = api_instance.get_ttw_campaign(id)
|
32
|
+
p result
|
33
|
+
rescue DealMakerAPI::ApiError => e
|
34
|
+
puts "Error when calling CampaignApi->get_ttw_campaign: #{e}"
|
35
|
+
end
|
36
|
+
```
|
37
|
+
|
38
|
+
#### Using the get_ttw_campaign_with_http_info variant
|
39
|
+
|
40
|
+
This returns an Array which contains the response data, status code and headers.
|
41
|
+
|
42
|
+
> <Array(<V1EntitiesTtwCampaignResponse>, Integer, Hash)> get_ttw_campaign_with_http_info(id)
|
43
|
+
|
44
|
+
```ruby
|
45
|
+
begin
|
46
|
+
# Gets a TTW campaign for a given company
|
47
|
+
data, status_code, headers = api_instance.get_ttw_campaign_with_http_info(id)
|
48
|
+
p status_code # => 2xx
|
49
|
+
p headers # => { ... }
|
50
|
+
p data # => <V1EntitiesTtwCampaignResponse>
|
51
|
+
rescue DealMakerAPI::ApiError => e
|
52
|
+
puts "Error when calling CampaignApi->get_ttw_campaign_with_http_info: #{e}"
|
53
|
+
end
|
54
|
+
```
|
55
|
+
|
56
|
+
### Parameters
|
57
|
+
|
58
|
+
| Name | Type | Description | Notes |
|
59
|
+
| ---- | ---- | ----------- | ----- |
|
60
|
+
| **id** | **Integer** | | |
|
61
|
+
|
62
|
+
### Return type
|
63
|
+
|
64
|
+
[**V1EntitiesTtwCampaignResponse**](V1EntitiesTtwCampaignResponse.md)
|
65
|
+
|
66
|
+
### Authorization
|
67
|
+
|
68
|
+
No authorization required
|
69
|
+
|
70
|
+
### HTTP request headers
|
71
|
+
|
72
|
+
- **Content-Type**: Not defined
|
73
|
+
- **Accept**: application/json
|
74
|
+
|
@@ -10,6 +10,7 @@
|
|
10
10
|
| **value** | **Float** | Value | [optional] |
|
11
11
|
| **link** | **String** | Link | [optional] |
|
12
12
|
| **description** | **String** | Description | [optional] |
|
13
|
+
| **link_label** | **String** | Link Label | [optional] |
|
13
14
|
|
14
15
|
## Example
|
15
16
|
|
@@ -22,7 +23,8 @@ instance = DealMakerAPI::V1EntitiesDealsProgressPageSummaryItem.new(
|
|
22
23
|
negative: null,
|
23
24
|
value: null,
|
24
25
|
link: null,
|
25
|
-
description: null
|
26
|
+
description: null,
|
27
|
+
link_label: null
|
26
28
|
)
|
27
29
|
```
|
28
30
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# DealMakerAPI::V1EntitiesTtwCampaignResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
| Name | Type | Description | Notes |
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
7
|
+
| **id** | **Integer** | The campaign ID | [optional] |
|
8
|
+
| **name** | **String** | Campaign name | [optional] |
|
9
|
+
| **redirect_link** | **String** | Redirect link for the campaign | [optional] |
|
10
|
+
| **introduction_email** | **Boolean** | State of the introduction email | [optional] |
|
11
|
+
| **one_day_reminder_email** | **Boolean** | State of the 1 day reminder email | [optional] |
|
12
|
+
| **two_day_reminder_email** | **Boolean** | State of the 2 day reminder email | [optional] |
|
13
|
+
| **seven_day_reminder_email** | **Boolean** | State of the 7 day reminder email | [optional] |
|
14
|
+
| **confirmation_email** | **Boolean** | State of the confirmation email | [optional] |
|
15
|
+
|
16
|
+
## Example
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
require 'DealMakerAPI'
|
20
|
+
|
21
|
+
instance = DealMakerAPI::V1EntitiesTtwCampaignResponse.new(
|
22
|
+
id: null,
|
23
|
+
name: null,
|
24
|
+
redirect_link: null,
|
25
|
+
introduction_email: null,
|
26
|
+
one_day_reminder_email: null,
|
27
|
+
two_day_reminder_email: null,
|
28
|
+
seven_day_reminder_email: null,
|
29
|
+
confirmation_email: null
|
30
|
+
)
|
31
|
+
```
|
32
|
+
|
@@ -0,0 +1,85 @@
|
|
1
|
+
=begin
|
2
|
+
#DealMaker API
|
3
|
+
|
4
|
+
## Introduction Welcome to DealMaker’s Web API v1! This API is RESTful, easy to integrate with, and offers support in 2 different languages. This is the technical documentation for our API. There are tutorials and examples of integrations with our API available on our [knowledge centre](https://help.dealmaker.tech/training-centre) as well. # Libraries - Javascript - Ruby # Authentication To authenticate, add an Authorization header to your API request that contains an access token. Before you [generate an access token](#how-to-generate-an-access-token) your must first [create an application](#create-an-application) on your portal and retrieve the your client ID and secret ## Create an Application DealMaker’s Web API v1 supports the use of OAuth applications. Applications can be generated in your [account](https://app.dealmaker.tech/developer/applications). To create an API Application, click on your user name in the top right corner to open a dropdown menu, and select \"Integrations\". Under the API settings tab, click the `Create New Application` button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-1.png) Name your application and assign the level of permissions for this application ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-2.png) Once your application is created, save in a secure space your client ID and secret. **WARNING**: The secret key will not be visible after you click the close button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-3.png) From the developer tab, you will be able to view and manage all the available applications ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-4.png) Each Application consists of a client id, secret and set of scopes. The scopes define what resources you want to have access to. The client ID and secret are used to generate an access token. You will need to create an application to use API endpoints. ## How to generate an access token After creating an application, you must make a call to obtain a bearer token using the Generate an OAuth token operation. This operation requires the following parameters: `token endpoint` - https://app.dealmaker.tech/oauth/token `grant_type` - must be set to `client_credentials` `client_id` - the Client ID displayed when you created the OAuth application in the previous step `client_secret` - the Client Secret displayed when you created the OAuth application in the previous step `scope` - the scope is established when you created the OAuth application in the previous step Note: The Generate an OAuth token response specifies how long the bearer token is valid for. You should reuse the bearer token until it is expired. When the token is expired, call Generate an OAuth token again to generate a new one. To use the access token, you must set a plain text header named `Authorization` with the contents of the header being “Bearer XXX” where XXX is your generated access token. ### Example #### Postman Here's an example on how to generate the access token with Postman, where `{{CLIENT_ID}}` and `{{CLIENT_SECRET}}` are the values generated after following the steps on [Create an Application](#create-an-application) ![Get access token postman example](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/token-postman.png) # Status Codes ## Content-Type Header All responses are returned in JSON format. We specify this by sending the Content-Type header. ## Status Codes Below is a table containing descriptions of the various status codes we currently support against various resources. Sometimes your API call will generate an error. Here you will find additional information about what to expect if you don’t format your request properly, or we fail to properly process your request. | Status Code | Description | | ----------- | ----------- | | `200` | Success | | `403` | Forbidden | | `404` | Not found | # Pagination Pagination is used to divide large responses is smaller portions (pages). By default, all endpoints return a maximum of 25 records per page. You can change the number of records on a per request basis by passing a `per_page` parameter in the request header parameters. The largest supported `per_page` parameter is 100. When the response exceeds the `per_page` parameter, you can paginate through the records by increasing the `offset` parameter. Example: `offset=25` will return 25 records starting from 26th record. You may also paginate using the `page` parameter to indicate the page number you would like to show on the response. Please review the table below for the input parameters ## Inputs | Parameter | Description | | ---------- | ------------------------------------------------------------------------------- | | `per_page` | Amount of records included on each page (Default is 25) | | `page` | Page number | | `offset` | Amount of records offset on the API request where 0 represents the first record | ## Response Headers | Response Header | Description | | --------------- | -------------------------------------------- | | `X-Total` | Total number of records of response | | `X-Total-Pages` | Total number of pages of response | | `X-Per-Page` | Total number of records per page of response | | `X-Page` | Number of current page | | `X-Next-Page` | Number of next page | | `X-Prev-Page` | Number of previous page | | `X-Offset` | Total number of records offset | # Search and Filtering (The q parameter) The q optional parameter accepts a string as input and allows you to filter the request based on that string. Please note that search strings must be encoded according to ASCII. For example, \"john+investor@dealmaker.tech\" should be passed as “john%2Binvestor%40dealmaker.tech”. There are two main ways to filter with it. ## Keyword filtering Some keywords allow you to filter investors based on a specific “scope” of the investors, for example using the string “Invited” will filter all investors with the status invited, and the keyword “Has attachments” will filter investors with attachments. Here’s a list of possible keywords and the “scope” each one of the keywords filters by: | Keywords | Scope | Decoded Example | Encoded Example | | ---------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | Signed on \\(date range\\) | Investors who signed in the provided date range | Signed on (date range) [2020-07-01:2020-07-31] | `Signed%20on%20%28date%20range%29%20%5B2020-07-01%3A2020-07-31%5D` | | Enabled for countersignature on \\(date range\\) | Investors who were enabled for counter signature in the provided date range | Enabled for countersignature on (date range) [2022-05-24:2022-05-25] | `Enabled%20for%20countersignature%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Accepted on \\(date range\\) | Investors accepted in the provided date rage | Accepted on (date range) [2022-05-24:2022-05-25] | `Accepted%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Offline | Investors added to the deal offline | Offline | `Offline` | | Online | Investors added to the deal online | Online | `Online` | | Signed | Investors who signed their agreement | Signed | `Signed` | | Waiting for countersignature | Investors who have signed and are waiting for counter signature | Waiting for countersignature | `Waiting%20for%20countersignature` | | Invited | Investors on the Invited Status | Invited | `Invited` | | Accepted | Investors in the Accepted Status | Accepted | `Accepted` | | Questionnaire in progress | All Investors who have not finished completing the questionnaire | Questionnaire in progress | `Questionnaire%20in%20progress` | | Has attachments | All Investors with attachments | Has attachments | `Has%20attachments` | | Has notes | All Investors with notes | Has notes | `Has%20notes` | | Waiting for co-signature | Investors who have signed and are waiting for co-signature | Waiting for co-signature | `Waiting%20for%20co-signature` | | Background Check Approved | Investors with approved background check | Background Check Approved | `Background%20Check%20Approved` | | Document Review Pending | Investors with pending review | Document Review Pending | `Document%20Review%20Pending` | | Document Upload Pending | Investors with pending documents to upload | Document Upload Pending | `Document%20Upload%20Pending` | | Required adjudicator review | Investors who are required to be review by the adjudicator | Required adjudicator review | `Required%20adjudicator%20review` | --- **NOTE** Filtering keywords are case sensitive and need to be encoded --- ## Search String Any value for the parameter which does not match one of the keywords listed above, will use fields like `first name`, `last name`, `email`, `tags` to search for the investor. For example, if you search “Robert”, because this does not match one of the keywords listed above, it will then return any investors who have the string “Robert” in their name, email, or tags fields. # Versioning The latest version is v1. The version can be updated on the `Accept` header, just set the version as stated on the following example: ``` Accept:application/vnd.dealmaker-v1+json ``` | Version | Accept Header | | ------- | ----------------------------------- | | `v1` | application/vnd.dealmaker-`v1`+json | # SDK’s For instruction on installing SDKs, please view the following links - [Javascript](https://github.com/DealMakerTech/api/tree/main/v1/clients/javascript) - [Ruby](https://github.com/DealMakerTech/api/tree/main/v1/clients/ruby) # Webhooks Our webhooks functionality allows clients to automatically receive updates on a deal's investor data. Some of the data that the webhooks include: - Investor Name - Date created - Email - Phone - Allocation - Attachments - Accredited investor status - Accredited investor category - State (Draft, Invited, Signed, Accepted, Waiting, Inactive) Via webhooks clients can subscribe to the following events as they happen on Dealmaker: - Investor is created - Investor details are updated (any of the investor details above change or are updated) - Investor has signed their agreement - Invertor fully funded their investment - Investor has been accepted - Investor is deleted A URL supplied by the client will receive all the events with the information as part of the payload. Clients are able to add and update the URL within DealMaker. ## Configuration For a comprehensive guide on how to configure Webhooks please visit our support article: [Configuring Webhooks on DealMaker – DealMaker Support](https://help.dealmaker.tech/configuring-webhooks-on-dealmaker). As a developer user on DealMaker, you are able to configure webhooks by following the steps below: 1. Sign into Dealmaker 2. Go to **“Your profile”** in the top right corner 3. Access an **“Integrations”** configuration via the left menu 4. The developer configures webhooks by including: - The HTTPS URL where the request will be sent - Optionally, a security token that we would use to build a SHA1 hash that would be included in the request headers. The name of the header is `X-DealMaker-Signature`. If the secret is not specified, the hash won’t be included in the headers. - The Deal(s) to include in the webhook subscription - An email address that will be used to notify about errors. 5. The developers can disable webhooks temporarily if needed ## Specification ### Events The initial set of events will be related to the investor. The events are: 1. `investor.created` - Triggers every time a new investor is added to a deal 2. `investor.updated` - Triggers on updates to any of the following fields: - Status - Name - Email - (this is a user field so we trigger event for all investors with webhook subscription) - Allocated Amount - Investment Amount - Accredited investor fields - Adding or removing attachments - Tags - When the investor status is signed, the payload also includes a link to the signed document; the link expires after 30 minutes 3. `investor.signed` - Triggers when the investor signs their subscription agreement (terms and conditions) - When this happens the investor.state becomes `signed` - This event includes the same fields as the `investor.updated` event 4. `investor.funded` - Triggers when the investor becomes fully funded - This happens when the investor.funded_state becomes `funded` - This event includes the same fields as the `investor.updated` event 5. `investor.accepted` - Triggers when the investor is countersigned - When this happens the investor.state becomes `accepted` - This event includes the same fields as the `investor.updated` event 6. `investor.deleted` - Triggers when the investor is removed from the deal - The investor key of the payload only includes investor ID - The deal is not included in the payload. Due to our implementation it’s impossible to retrieve the deal the investor was part of ### Requests - The request is a `POST` - The payload’s `content-type` is `application/json` - Only `2XX` responses are considered successful. In the event of a different response, we consider it failed and queue the event for retry - We retry the request five times, after the initial attempt. Doubling the waiting time between intervals with each try. The first retry happens after 30 seconds, then 60 seconds, 2 mins, 4 minutes, and 8 minutes. This timing scheme gives the receiver about 1 hour if all the requests fail - If an event fails all the attempts to be delivered, we send an email to the address that the user configured ### Payload #### Common Properties There will be some properties that are common to all the events on the system. | Key | Type | Description | | ----------------- | ------ | -------------------------------------------------------------------------------------- | | event | String | The event that triggered the call | | event_id | String | A unique identifier for the event | | deal<sup>\\*</sup> | Object | The deal in which the event occurred. please see below for an example on the deal object<sup>\\*\\*</sup> | <sup>\\*</sup>This field is not included when deleting a resource <sup>\\*\\*</sup> Sample Deal Object in the webhook payload ```json \"deal\": { \"id\": 0, \"title\": \"string\", \"created_at\": \"2022-12-06T18:14:44.000Z\", \"updated_at\": \"2022-12-08T12:46:48.000Z\", \"state\": \"string\", \"currency\": \"string\", \"security_type\": \"string\", \"price_per_security\": 0.00, \"deal_type\": \"string\", \"minimum_investment\": 0, \"maximum_investment\": 0, \"issuer\": { \"id\": 0, \"name\": \"string\" }, \"enterprise\": { \"id\": 0, \"name\": \"string\" } } ``` #### Common Properties (investor scope) By design, we have incorporated on the webhooks payload the same investor-related fields included in the Investor model, for reference on the included fields, their types and values please click [here](https://docs.dealmaker.tech/#tag/investor_model). This will allow you to get all the necessary information you need about a particular investor without having to call the Get Investor by ID endpoint. | #### Investor State Here is a brief description of each investor state: - **Draft:** the investor is added to the platform but hasn't been invited yet and cannot access the portal - **Invited:** the investor was added to the platform but hasn’t completed the questionnaire - **Signed:** the investor signed the document (needs approval from Lawyer or Reviewer before countersignature) - **Waiting:** the investor was approved for countersignature by any of the Lawyers or Reviewers in the deal - **Accepted:** the investor's agreement was countersigned by the Signatory - **Inactive** the investor is no longer eligible to participate in the offering. This may be because their warrant expired, they requested a refund, or they opted out of the offering #### Update Delay Given the high number of updates our platform performs on any investor, we’ve added a cool down period on update events that allows us to “group” updates and trigger only one every minute. In consequence, update events will be delivered 1 minute after the initial request was made and will include the latest version of the investor data at delivery time.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.75.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module DealMakerAPI
|
16
|
+
class CampaignApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Gets a TTW campaign for a given company
|
23
|
+
# Gets a TTW campaign for a given company
|
24
|
+
# @param id [Integer]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @return [V1EntitiesTtwCampaignResponse]
|
27
|
+
def get_ttw_campaign(id, opts = {})
|
28
|
+
data, _status_code, _headers = get_ttw_campaign_with_http_info(id, opts)
|
29
|
+
data
|
30
|
+
end
|
31
|
+
|
32
|
+
# Gets a TTW campaign for a given company
|
33
|
+
# Gets a TTW campaign for a given company
|
34
|
+
# @param id [Integer]
|
35
|
+
# @param [Hash] opts the optional parameters
|
36
|
+
# @return [Array<(V1EntitiesTtwCampaignResponse, Integer, Hash)>] V1EntitiesTtwCampaignResponse data, response status code and response headers
|
37
|
+
def get_ttw_campaign_with_http_info(id, opts = {})
|
38
|
+
if @api_client.config.debugging
|
39
|
+
@api_client.config.logger.debug 'Calling API: CampaignApi.get_ttw_campaign ...'
|
40
|
+
end
|
41
|
+
# verify the required parameter 'id' is set
|
42
|
+
if @api_client.config.client_side_validation && id.nil?
|
43
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling CampaignApi.get_ttw_campaign"
|
44
|
+
end
|
45
|
+
# resource path
|
46
|
+
local_var_path = '/ttw/campaigns/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
47
|
+
|
48
|
+
# query parameters
|
49
|
+
query_params = opts[:query_params] || {}
|
50
|
+
|
51
|
+
# header parameters
|
52
|
+
header_params = opts[:header_params] || {}
|
53
|
+
# HTTP header 'Accept' (if needed)
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
55
|
+
|
56
|
+
# form parameters
|
57
|
+
form_params = opts[:form_params] || {}
|
58
|
+
|
59
|
+
# http body (model)
|
60
|
+
post_body = opts[:debug_body]
|
61
|
+
|
62
|
+
# return_type
|
63
|
+
return_type = opts[:debug_return_type] || 'V1EntitiesTtwCampaignResponse'
|
64
|
+
|
65
|
+
# auth_names
|
66
|
+
auth_names = opts[:debug_auth_names] || []
|
67
|
+
|
68
|
+
new_options = opts.merge(
|
69
|
+
:operation => :"CampaignApi.get_ttw_campaign",
|
70
|
+
:header_params => header_params,
|
71
|
+
:query_params => query_params,
|
72
|
+
:form_params => form_params,
|
73
|
+
:body => post_body,
|
74
|
+
:auth_names => auth_names,
|
75
|
+
:return_type => return_type
|
76
|
+
)
|
77
|
+
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
79
|
+
if @api_client.config.debugging
|
80
|
+
@api_client.config.logger.debug "API called: CampaignApi#get_ttw_campaign\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
81
|
+
end
|
82
|
+
return data, status_code, headers
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
@@ -33,6 +33,9 @@ module DealMakerAPI
|
|
33
33
|
# Description
|
34
34
|
attr_accessor :description
|
35
35
|
|
36
|
+
# Link Label
|
37
|
+
attr_accessor :link_label
|
38
|
+
|
36
39
|
# Attribute mapping from ruby-style variable name to JSON key.
|
37
40
|
def self.attribute_map
|
38
41
|
{
|
@@ -41,7 +44,8 @@ module DealMakerAPI
|
|
41
44
|
:'negative' => :'negative',
|
42
45
|
:'value' => :'value',
|
43
46
|
:'link' => :'link',
|
44
|
-
:'description' => :'description'
|
47
|
+
:'description' => :'description',
|
48
|
+
:'link_label' => :'link_label'
|
45
49
|
}
|
46
50
|
end
|
47
51
|
|
@@ -58,7 +62,8 @@ module DealMakerAPI
|
|
58
62
|
:'negative' => :'Boolean',
|
59
63
|
:'value' => :'Float',
|
60
64
|
:'link' => :'String',
|
61
|
-
:'description' => :'String'
|
65
|
+
:'description' => :'String',
|
66
|
+
:'link_label' => :'String'
|
62
67
|
}
|
63
68
|
end
|
64
69
|
|
@@ -106,6 +111,10 @@ module DealMakerAPI
|
|
106
111
|
if attributes.key?(:'description')
|
107
112
|
self.description = attributes[:'description']
|
108
113
|
end
|
114
|
+
|
115
|
+
if attributes.key?(:'link_label')
|
116
|
+
self.link_label = attributes[:'link_label']
|
117
|
+
end
|
109
118
|
end
|
110
119
|
|
111
120
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -133,7 +142,8 @@ module DealMakerAPI
|
|
133
142
|
negative == o.negative &&
|
134
143
|
value == o.value &&
|
135
144
|
link == o.link &&
|
136
|
-
description == o.description
|
145
|
+
description == o.description &&
|
146
|
+
link_label == o.link_label
|
137
147
|
end
|
138
148
|
|
139
149
|
# @see the `==` method
|
@@ -145,7 +155,7 @@ module DealMakerAPI
|
|
145
155
|
# Calculates hash code according to all attributes.
|
146
156
|
# @return [Integer] Hash code
|
147
157
|
def hash
|
148
|
-
[label, highlighted, negative, value, link, description].hash
|
158
|
+
[label, highlighted, negative, value, link, description, link_label].hash
|
149
159
|
end
|
150
160
|
|
151
161
|
# Builds the object from hash
|
@@ -0,0 +1,286 @@
|
|
1
|
+
=begin
|
2
|
+
#DealMaker API
|
3
|
+
|
4
|
+
## Introduction Welcome to DealMaker’s Web API v1! This API is RESTful, easy to integrate with, and offers support in 2 different languages. This is the technical documentation for our API. There are tutorials and examples of integrations with our API available on our [knowledge centre](https://help.dealmaker.tech/training-centre) as well. # Libraries - Javascript - Ruby # Authentication To authenticate, add an Authorization header to your API request that contains an access token. Before you [generate an access token](#how-to-generate-an-access-token) your must first [create an application](#create-an-application) on your portal and retrieve the your client ID and secret ## Create an Application DealMaker’s Web API v1 supports the use of OAuth applications. Applications can be generated in your [account](https://app.dealmaker.tech/developer/applications). To create an API Application, click on your user name in the top right corner to open a dropdown menu, and select \"Integrations\". Under the API settings tab, click the `Create New Application` button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-1.png) Name your application and assign the level of permissions for this application ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-2.png) Once your application is created, save in a secure space your client ID and secret. **WARNING**: The secret key will not be visible after you click the close button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-3.png) From the developer tab, you will be able to view and manage all the available applications ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-4.png) Each Application consists of a client id, secret and set of scopes. The scopes define what resources you want to have access to. The client ID and secret are used to generate an access token. You will need to create an application to use API endpoints. ## How to generate an access token After creating an application, you must make a call to obtain a bearer token using the Generate an OAuth token operation. This operation requires the following parameters: `token endpoint` - https://app.dealmaker.tech/oauth/token `grant_type` - must be set to `client_credentials` `client_id` - the Client ID displayed when you created the OAuth application in the previous step `client_secret` - the Client Secret displayed when you created the OAuth application in the previous step `scope` - the scope is established when you created the OAuth application in the previous step Note: The Generate an OAuth token response specifies how long the bearer token is valid for. You should reuse the bearer token until it is expired. When the token is expired, call Generate an OAuth token again to generate a new one. To use the access token, you must set a plain text header named `Authorization` with the contents of the header being “Bearer XXX” where XXX is your generated access token. ### Example #### Postman Here's an example on how to generate the access token with Postman, where `{{CLIENT_ID}}` and `{{CLIENT_SECRET}}` are the values generated after following the steps on [Create an Application](#create-an-application) ![Get access token postman example](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/token-postman.png) # Status Codes ## Content-Type Header All responses are returned in JSON format. We specify this by sending the Content-Type header. ## Status Codes Below is a table containing descriptions of the various status codes we currently support against various resources. Sometimes your API call will generate an error. Here you will find additional information about what to expect if you don’t format your request properly, or we fail to properly process your request. | Status Code | Description | | ----------- | ----------- | | `200` | Success | | `403` | Forbidden | | `404` | Not found | # Pagination Pagination is used to divide large responses is smaller portions (pages). By default, all endpoints return a maximum of 25 records per page. You can change the number of records on a per request basis by passing a `per_page` parameter in the request header parameters. The largest supported `per_page` parameter is 100. When the response exceeds the `per_page` parameter, you can paginate through the records by increasing the `offset` parameter. Example: `offset=25` will return 25 records starting from 26th record. You may also paginate using the `page` parameter to indicate the page number you would like to show on the response. Please review the table below for the input parameters ## Inputs | Parameter | Description | | ---------- | ------------------------------------------------------------------------------- | | `per_page` | Amount of records included on each page (Default is 25) | | `page` | Page number | | `offset` | Amount of records offset on the API request where 0 represents the first record | ## Response Headers | Response Header | Description | | --------------- | -------------------------------------------- | | `X-Total` | Total number of records of response | | `X-Total-Pages` | Total number of pages of response | | `X-Per-Page` | Total number of records per page of response | | `X-Page` | Number of current page | | `X-Next-Page` | Number of next page | | `X-Prev-Page` | Number of previous page | | `X-Offset` | Total number of records offset | # Search and Filtering (The q parameter) The q optional parameter accepts a string as input and allows you to filter the request based on that string. Please note that search strings must be encoded according to ASCII. For example, \"john+investor@dealmaker.tech\" should be passed as “john%2Binvestor%40dealmaker.tech”. There are two main ways to filter with it. ## Keyword filtering Some keywords allow you to filter investors based on a specific “scope” of the investors, for example using the string “Invited” will filter all investors with the status invited, and the keyword “Has attachments” will filter investors with attachments. Here’s a list of possible keywords and the “scope” each one of the keywords filters by: | Keywords | Scope | Decoded Example | Encoded Example | | ---------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | Signed on \\(date range\\) | Investors who signed in the provided date range | Signed on (date range) [2020-07-01:2020-07-31] | `Signed%20on%20%28date%20range%29%20%5B2020-07-01%3A2020-07-31%5D` | | Enabled for countersignature on \\(date range\\) | Investors who were enabled for counter signature in the provided date range | Enabled for countersignature on (date range) [2022-05-24:2022-05-25] | `Enabled%20for%20countersignature%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Accepted on \\(date range\\) | Investors accepted in the provided date rage | Accepted on (date range) [2022-05-24:2022-05-25] | `Accepted%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Offline | Investors added to the deal offline | Offline | `Offline` | | Online | Investors added to the deal online | Online | `Online` | | Signed | Investors who signed their agreement | Signed | `Signed` | | Waiting for countersignature | Investors who have signed and are waiting for counter signature | Waiting for countersignature | `Waiting%20for%20countersignature` | | Invited | Investors on the Invited Status | Invited | `Invited` | | Accepted | Investors in the Accepted Status | Accepted | `Accepted` | | Questionnaire in progress | All Investors who have not finished completing the questionnaire | Questionnaire in progress | `Questionnaire%20in%20progress` | | Has attachments | All Investors with attachments | Has attachments | `Has%20attachments` | | Has notes | All Investors with notes | Has notes | `Has%20notes` | | Waiting for co-signature | Investors who have signed and are waiting for co-signature | Waiting for co-signature | `Waiting%20for%20co-signature` | | Background Check Approved | Investors with approved background check | Background Check Approved | `Background%20Check%20Approved` | | Document Review Pending | Investors with pending review | Document Review Pending | `Document%20Review%20Pending` | | Document Upload Pending | Investors with pending documents to upload | Document Upload Pending | `Document%20Upload%20Pending` | | Required adjudicator review | Investors who are required to be review by the adjudicator | Required adjudicator review | `Required%20adjudicator%20review` | --- **NOTE** Filtering keywords are case sensitive and need to be encoded --- ## Search String Any value for the parameter which does not match one of the keywords listed above, will use fields like `first name`, `last name`, `email`, `tags` to search for the investor. For example, if you search “Robert”, because this does not match one of the keywords listed above, it will then return any investors who have the string “Robert” in their name, email, or tags fields. # Versioning The latest version is v1. The version can be updated on the `Accept` header, just set the version as stated on the following example: ``` Accept:application/vnd.dealmaker-v1+json ``` | Version | Accept Header | | ------- | ----------------------------------- | | `v1` | application/vnd.dealmaker-`v1`+json | # SDK’s For instruction on installing SDKs, please view the following links - [Javascript](https://github.com/DealMakerTech/api/tree/main/v1/clients/javascript) - [Ruby](https://github.com/DealMakerTech/api/tree/main/v1/clients/ruby) # Webhooks Our webhooks functionality allows clients to automatically receive updates on a deal's investor data. Some of the data that the webhooks include: - Investor Name - Date created - Email - Phone - Allocation - Attachments - Accredited investor status - Accredited investor category - State (Draft, Invited, Signed, Accepted, Waiting, Inactive) Via webhooks clients can subscribe to the following events as they happen on Dealmaker: - Investor is created - Investor details are updated (any of the investor details above change or are updated) - Investor has signed their agreement - Invertor fully funded their investment - Investor has been accepted - Investor is deleted A URL supplied by the client will receive all the events with the information as part of the payload. Clients are able to add and update the URL within DealMaker. ## Configuration For a comprehensive guide on how to configure Webhooks please visit our support article: [Configuring Webhooks on DealMaker – DealMaker Support](https://help.dealmaker.tech/configuring-webhooks-on-dealmaker). As a developer user on DealMaker, you are able to configure webhooks by following the steps below: 1. Sign into Dealmaker 2. Go to **“Your profile”** in the top right corner 3. Access an **“Integrations”** configuration via the left menu 4. The developer configures webhooks by including: - The HTTPS URL where the request will be sent - Optionally, a security token that we would use to build a SHA1 hash that would be included in the request headers. The name of the header is `X-DealMaker-Signature`. If the secret is not specified, the hash won’t be included in the headers. - The Deal(s) to include in the webhook subscription - An email address that will be used to notify about errors. 5. The developers can disable webhooks temporarily if needed ## Specification ### Events The initial set of events will be related to the investor. The events are: 1. `investor.created` - Triggers every time a new investor is added to a deal 2. `investor.updated` - Triggers on updates to any of the following fields: - Status - Name - Email - (this is a user field so we trigger event for all investors with webhook subscription) - Allocated Amount - Investment Amount - Accredited investor fields - Adding or removing attachments - Tags - When the investor status is signed, the payload also includes a link to the signed document; the link expires after 30 minutes 3. `investor.signed` - Triggers when the investor signs their subscription agreement (terms and conditions) - When this happens the investor.state becomes `signed` - This event includes the same fields as the `investor.updated` event 4. `investor.funded` - Triggers when the investor becomes fully funded - This happens when the investor.funded_state becomes `funded` - This event includes the same fields as the `investor.updated` event 5. `investor.accepted` - Triggers when the investor is countersigned - When this happens the investor.state becomes `accepted` - This event includes the same fields as the `investor.updated` event 6. `investor.deleted` - Triggers when the investor is removed from the deal - The investor key of the payload only includes investor ID - The deal is not included in the payload. Due to our implementation it’s impossible to retrieve the deal the investor was part of ### Requests - The request is a `POST` - The payload’s `content-type` is `application/json` - Only `2XX` responses are considered successful. In the event of a different response, we consider it failed and queue the event for retry - We retry the request five times, after the initial attempt. Doubling the waiting time between intervals with each try. The first retry happens after 30 seconds, then 60 seconds, 2 mins, 4 minutes, and 8 minutes. This timing scheme gives the receiver about 1 hour if all the requests fail - If an event fails all the attempts to be delivered, we send an email to the address that the user configured ### Payload #### Common Properties There will be some properties that are common to all the events on the system. | Key | Type | Description | | ----------------- | ------ | -------------------------------------------------------------------------------------- | | event | String | The event that triggered the call | | event_id | String | A unique identifier for the event | | deal<sup>\\*</sup> | Object | The deal in which the event occurred. please see below for an example on the deal object<sup>\\*\\*</sup> | <sup>\\*</sup>This field is not included when deleting a resource <sup>\\*\\*</sup> Sample Deal Object in the webhook payload ```json \"deal\": { \"id\": 0, \"title\": \"string\", \"created_at\": \"2022-12-06T18:14:44.000Z\", \"updated_at\": \"2022-12-08T12:46:48.000Z\", \"state\": \"string\", \"currency\": \"string\", \"security_type\": \"string\", \"price_per_security\": 0.00, \"deal_type\": \"string\", \"minimum_investment\": 0, \"maximum_investment\": 0, \"issuer\": { \"id\": 0, \"name\": \"string\" }, \"enterprise\": { \"id\": 0, \"name\": \"string\" } } ``` #### Common Properties (investor scope) By design, we have incorporated on the webhooks payload the same investor-related fields included in the Investor model, for reference on the included fields, their types and values please click [here](https://docs.dealmaker.tech/#tag/investor_model). This will allow you to get all the necessary information you need about a particular investor without having to call the Get Investor by ID endpoint. | #### Investor State Here is a brief description of each investor state: - **Draft:** the investor is added to the platform but hasn't been invited yet and cannot access the portal - **Invited:** the investor was added to the platform but hasn’t completed the questionnaire - **Signed:** the investor signed the document (needs approval from Lawyer or Reviewer before countersignature) - **Waiting:** the investor was approved for countersignature by any of the Lawyers or Reviewers in the deal - **Accepted:** the investor's agreement was countersigned by the Signatory - **Inactive** the investor is no longer eligible to participate in the offering. This may be because their warrant expired, they requested a refund, or they opted out of the offering #### Update Delay Given the high number of updates our platform performs on any investor, we’ve added a cool down period on update events that allows us to “group” updates and trigger only one every minute. In consequence, update events will be delivered 1 minute after the initial request was made and will include the latest version of the investor data at delivery time.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.75.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module DealMakerAPI
|
17
|
+
# V1_Entities_Ttw_Campaign_Response model
|
18
|
+
class V1EntitiesTtwCampaignResponse
|
19
|
+
# The campaign ID
|
20
|
+
attr_accessor :id
|
21
|
+
|
22
|
+
# Campaign name
|
23
|
+
attr_accessor :name
|
24
|
+
|
25
|
+
# Redirect link for the campaign
|
26
|
+
attr_accessor :redirect_link
|
27
|
+
|
28
|
+
# State of the introduction email
|
29
|
+
attr_accessor :introduction_email
|
30
|
+
|
31
|
+
# State of the 1 day reminder email
|
32
|
+
attr_accessor :one_day_reminder_email
|
33
|
+
|
34
|
+
# State of the 2 day reminder email
|
35
|
+
attr_accessor :two_day_reminder_email
|
36
|
+
|
37
|
+
# State of the 7 day reminder email
|
38
|
+
attr_accessor :seven_day_reminder_email
|
39
|
+
|
40
|
+
# State of the confirmation email
|
41
|
+
attr_accessor :confirmation_email
|
42
|
+
|
43
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
44
|
+
def self.attribute_map
|
45
|
+
{
|
46
|
+
:'id' => :'id',
|
47
|
+
:'name' => :'name',
|
48
|
+
:'redirect_link' => :'redirect_link',
|
49
|
+
:'introduction_email' => :'introduction_email',
|
50
|
+
:'one_day_reminder_email' => :'one_day_reminder_email',
|
51
|
+
:'two_day_reminder_email' => :'two_day_reminder_email',
|
52
|
+
:'seven_day_reminder_email' => :'seven_day_reminder_email',
|
53
|
+
:'confirmation_email' => :'confirmation_email'
|
54
|
+
}
|
55
|
+
end
|
56
|
+
|
57
|
+
# Returns all the JSON keys this model knows about
|
58
|
+
def self.acceptable_attributes
|
59
|
+
attribute_map.values
|
60
|
+
end
|
61
|
+
|
62
|
+
# Attribute type mapping.
|
63
|
+
def self.openapi_types
|
64
|
+
{
|
65
|
+
:'id' => :'Integer',
|
66
|
+
:'name' => :'String',
|
67
|
+
:'redirect_link' => :'String',
|
68
|
+
:'introduction_email' => :'Boolean',
|
69
|
+
:'one_day_reminder_email' => :'Boolean',
|
70
|
+
:'two_day_reminder_email' => :'Boolean',
|
71
|
+
:'seven_day_reminder_email' => :'Boolean',
|
72
|
+
:'confirmation_email' => :'Boolean'
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
# List of attributes with nullable: true
|
77
|
+
def self.openapi_nullable
|
78
|
+
Set.new([
|
79
|
+
])
|
80
|
+
end
|
81
|
+
|
82
|
+
# Initializes the object
|
83
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
84
|
+
def initialize(attributes = {})
|
85
|
+
if (!attributes.is_a?(Hash))
|
86
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `DealMakerAPI::V1EntitiesTtwCampaignResponse` initialize method"
|
87
|
+
end
|
88
|
+
|
89
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
91
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `DealMakerAPI::V1EntitiesTtwCampaignResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
93
|
+
end
|
94
|
+
h[k.to_sym] = v
|
95
|
+
}
|
96
|
+
|
97
|
+
if attributes.key?(:'id')
|
98
|
+
self.id = attributes[:'id']
|
99
|
+
end
|
100
|
+
|
101
|
+
if attributes.key?(:'name')
|
102
|
+
self.name = attributes[:'name']
|
103
|
+
end
|
104
|
+
|
105
|
+
if attributes.key?(:'redirect_link')
|
106
|
+
self.redirect_link = attributes[:'redirect_link']
|
107
|
+
end
|
108
|
+
|
109
|
+
if attributes.key?(:'introduction_email')
|
110
|
+
self.introduction_email = attributes[:'introduction_email']
|
111
|
+
end
|
112
|
+
|
113
|
+
if attributes.key?(:'one_day_reminder_email')
|
114
|
+
self.one_day_reminder_email = attributes[:'one_day_reminder_email']
|
115
|
+
end
|
116
|
+
|
117
|
+
if attributes.key?(:'two_day_reminder_email')
|
118
|
+
self.two_day_reminder_email = attributes[:'two_day_reminder_email']
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'seven_day_reminder_email')
|
122
|
+
self.seven_day_reminder_email = attributes[:'seven_day_reminder_email']
|
123
|
+
end
|
124
|
+
|
125
|
+
if attributes.key?(:'confirmation_email')
|
126
|
+
self.confirmation_email = attributes[:'confirmation_email']
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
131
|
+
# @return Array for valid properties with the reasons
|
132
|
+
def list_invalid_properties
|
133
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
134
|
+
invalid_properties = Array.new
|
135
|
+
invalid_properties
|
136
|
+
end
|
137
|
+
|
138
|
+
# Check to see if the all the properties in the model are valid
|
139
|
+
# @return true if the model is valid
|
140
|
+
def valid?
|
141
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
142
|
+
true
|
143
|
+
end
|
144
|
+
|
145
|
+
# Checks equality by comparing each attribute.
|
146
|
+
# @param [Object] Object to be compared
|
147
|
+
def ==(o)
|
148
|
+
return true if self.equal?(o)
|
149
|
+
self.class == o.class &&
|
150
|
+
id == o.id &&
|
151
|
+
name == o.name &&
|
152
|
+
redirect_link == o.redirect_link &&
|
153
|
+
introduction_email == o.introduction_email &&
|
154
|
+
one_day_reminder_email == o.one_day_reminder_email &&
|
155
|
+
two_day_reminder_email == o.two_day_reminder_email &&
|
156
|
+
seven_day_reminder_email == o.seven_day_reminder_email &&
|
157
|
+
confirmation_email == o.confirmation_email
|
158
|
+
end
|
159
|
+
|
160
|
+
# @see the `==` method
|
161
|
+
# @param [Object] Object to be compared
|
162
|
+
def eql?(o)
|
163
|
+
self == o
|
164
|
+
end
|
165
|
+
|
166
|
+
# Calculates hash code according to all attributes.
|
167
|
+
# @return [Integer] Hash code
|
168
|
+
def hash
|
169
|
+
[id, name, redirect_link, introduction_email, one_day_reminder_email, two_day_reminder_email, seven_day_reminder_email, confirmation_email].hash
|
170
|
+
end
|
171
|
+
|
172
|
+
# Builds the object from hash
|
173
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
174
|
+
# @return [Object] Returns the model itself
|
175
|
+
def self.build_from_hash(attributes)
|
176
|
+
return nil unless attributes.is_a?(Hash)
|
177
|
+
attributes = attributes.transform_keys(&:to_sym)
|
178
|
+
transformed_hash = {}
|
179
|
+
openapi_types.each_pair do |key, type|
|
180
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
181
|
+
transformed_hash["#{key}"] = nil
|
182
|
+
elsif type =~ /\AArray<(.*)>/i
|
183
|
+
# check to ensure the input is an array given that the attribute
|
184
|
+
# is documented as an array but the input is not
|
185
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
186
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
187
|
+
end
|
188
|
+
elsif !attributes[attribute_map[key]].nil?
|
189
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
190
|
+
end
|
191
|
+
end
|
192
|
+
new(transformed_hash)
|
193
|
+
end
|
194
|
+
|
195
|
+
# Deserializes the data based on type
|
196
|
+
# @param string type Data type
|
197
|
+
# @param string value Value to be deserialized
|
198
|
+
# @return [Object] Deserialized data
|
199
|
+
def self._deserialize(type, value)
|
200
|
+
case type.to_sym
|
201
|
+
when :Time
|
202
|
+
Time.parse(value)
|
203
|
+
when :Date
|
204
|
+
Date.parse(value)
|
205
|
+
when :String
|
206
|
+
value.to_s
|
207
|
+
when :Integer
|
208
|
+
value.to_i
|
209
|
+
when :Float
|
210
|
+
value.to_f
|
211
|
+
when :Boolean
|
212
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
213
|
+
true
|
214
|
+
else
|
215
|
+
false
|
216
|
+
end
|
217
|
+
when :Object
|
218
|
+
# generic object (usually a Hash), return directly
|
219
|
+
value
|
220
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
221
|
+
inner_type = Regexp.last_match[:inner_type]
|
222
|
+
value.map { |v| _deserialize(inner_type, v) }
|
223
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
224
|
+
k_type = Regexp.last_match[:k_type]
|
225
|
+
v_type = Regexp.last_match[:v_type]
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each do |k, v|
|
228
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
else # model
|
232
|
+
# models (e.g. Pet) or oneOf
|
233
|
+
klass = DealMakerAPI.const_get(type)
|
234
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
# Returns the string representation of the object
|
239
|
+
# @return [String] String presentation of the object
|
240
|
+
def to_s
|
241
|
+
to_hash.to_s
|
242
|
+
end
|
243
|
+
|
244
|
+
# to_body is an alias to to_hash (backward compatibility)
|
245
|
+
# @return [Hash] Returns the object in the form of hash
|
246
|
+
def to_body
|
247
|
+
to_hash
|
248
|
+
end
|
249
|
+
|
250
|
+
# Returns the object in the form of hash
|
251
|
+
# @return [Hash] Returns the object in the form of hash
|
252
|
+
def to_hash
|
253
|
+
hash = {}
|
254
|
+
self.class.attribute_map.each_pair do |attr, param|
|
255
|
+
value = self.send(attr)
|
256
|
+
if value.nil?
|
257
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
258
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
259
|
+
end
|
260
|
+
|
261
|
+
hash[param] = _to_hash(value)
|
262
|
+
end
|
263
|
+
hash
|
264
|
+
end
|
265
|
+
|
266
|
+
# Outputs non-array value in the form of hash
|
267
|
+
# For object, use to_hash. Otherwise, just return the value
|
268
|
+
# @param [Object] value Any valid value
|
269
|
+
# @return [Hash] Returns the value in the form of hash
|
270
|
+
def _to_hash(value)
|
271
|
+
if value.is_a?(Array)
|
272
|
+
value.compact.map { |v| _to_hash(v) }
|
273
|
+
elsif value.is_a?(Hash)
|
274
|
+
{}.tap do |hash|
|
275
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
276
|
+
end
|
277
|
+
elsif value.respond_to? :to_hash
|
278
|
+
value.to_hash
|
279
|
+
else
|
280
|
+
value
|
281
|
+
end
|
282
|
+
end
|
283
|
+
|
284
|
+
end
|
285
|
+
|
286
|
+
end
|
data/lib/DealMakerAPI/version.rb
CHANGED
data/lib/DealMakerAPI.rb
CHANGED
@@ -139,6 +139,7 @@ require 'DealMakerAPI/models/v1_entities_shareholders'
|
|
139
139
|
require 'DealMakerAPI/models/v1_entities_shareholders_tags'
|
140
140
|
require 'DealMakerAPI/models/v1_entities_state'
|
141
141
|
require 'DealMakerAPI/models/v1_entities_subscription_agreement'
|
142
|
+
require 'DealMakerAPI/models/v1_entities_ttw_campaign_response'
|
142
143
|
require 'DealMakerAPI/models/v1_entities_user'
|
143
144
|
require 'DealMakerAPI/models/v1_entities_users_binding'
|
144
145
|
require 'DealMakerAPI/models/v1_entities_users_factor'
|
@@ -154,6 +155,7 @@ require 'DealMakerAPI/models/verify_factor_request'
|
|
154
155
|
require 'DealMakerAPI/models/verify_sms_verification_request'
|
155
156
|
|
156
157
|
# APIs
|
158
|
+
require 'DealMakerAPI/api/campaign_api'
|
157
159
|
require 'DealMakerAPI/api/company_api'
|
158
160
|
require 'DealMakerAPI/api/country_api'
|
159
161
|
require 'DealMakerAPI/api/custom_emails_api'
|
@@ -0,0 +1,47 @@
|
|
1
|
+
=begin
|
2
|
+
#DealMaker API
|
3
|
+
|
4
|
+
## Introduction Welcome to DealMaker’s Web API v1! This API is RESTful, easy to integrate with, and offers support in 2 different languages. This is the technical documentation for our API. There are tutorials and examples of integrations with our API available on our [knowledge centre](https://help.dealmaker.tech/training-centre) as well. # Libraries - Javascript - Ruby # Authentication To authenticate, add an Authorization header to your API request that contains an access token. Before you [generate an access token](#how-to-generate-an-access-token) your must first [create an application](#create-an-application) on your portal and retrieve the your client ID and secret ## Create an Application DealMaker’s Web API v1 supports the use of OAuth applications. Applications can be generated in your [account](https://app.dealmaker.tech/developer/applications). To create an API Application, click on your user name in the top right corner to open a dropdown menu, and select \"Integrations\". Under the API settings tab, click the `Create New Application` button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-1.png) Name your application and assign the level of permissions for this application ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-2.png) Once your application is created, save in a secure space your client ID and secret. **WARNING**: The secret key will not be visible after you click the close button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-3.png) From the developer tab, you will be able to view and manage all the available applications ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-4.png) Each Application consists of a client id, secret and set of scopes. The scopes define what resources you want to have access to. The client ID and secret are used to generate an access token. You will need to create an application to use API endpoints. ## How to generate an access token After creating an application, you must make a call to obtain a bearer token using the Generate an OAuth token operation. This operation requires the following parameters: `token endpoint` - https://app.dealmaker.tech/oauth/token `grant_type` - must be set to `client_credentials` `client_id` - the Client ID displayed when you created the OAuth application in the previous step `client_secret` - the Client Secret displayed when you created the OAuth application in the previous step `scope` - the scope is established when you created the OAuth application in the previous step Note: The Generate an OAuth token response specifies how long the bearer token is valid for. You should reuse the bearer token until it is expired. When the token is expired, call Generate an OAuth token again to generate a new one. To use the access token, you must set a plain text header named `Authorization` with the contents of the header being “Bearer XXX” where XXX is your generated access token. ### Example #### Postman Here's an example on how to generate the access token with Postman, where `{{CLIENT_ID}}` and `{{CLIENT_SECRET}}` are the values generated after following the steps on [Create an Application](#create-an-application) ![Get access token postman example](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/token-postman.png) # Status Codes ## Content-Type Header All responses are returned in JSON format. We specify this by sending the Content-Type header. ## Status Codes Below is a table containing descriptions of the various status codes we currently support against various resources. Sometimes your API call will generate an error. Here you will find additional information about what to expect if you don’t format your request properly, or we fail to properly process your request. | Status Code | Description | | ----------- | ----------- | | `200` | Success | | `403` | Forbidden | | `404` | Not found | # Pagination Pagination is used to divide large responses is smaller portions (pages). By default, all endpoints return a maximum of 25 records per page. You can change the number of records on a per request basis by passing a `per_page` parameter in the request header parameters. The largest supported `per_page` parameter is 100. When the response exceeds the `per_page` parameter, you can paginate through the records by increasing the `offset` parameter. Example: `offset=25` will return 25 records starting from 26th record. You may also paginate using the `page` parameter to indicate the page number you would like to show on the response. Please review the table below for the input parameters ## Inputs | Parameter | Description | | ---------- | ------------------------------------------------------------------------------- | | `per_page` | Amount of records included on each page (Default is 25) | | `page` | Page number | | `offset` | Amount of records offset on the API request where 0 represents the first record | ## Response Headers | Response Header | Description | | --------------- | -------------------------------------------- | | `X-Total` | Total number of records of response | | `X-Total-Pages` | Total number of pages of response | | `X-Per-Page` | Total number of records per page of response | | `X-Page` | Number of current page | | `X-Next-Page` | Number of next page | | `X-Prev-Page` | Number of previous page | | `X-Offset` | Total number of records offset | # Search and Filtering (The q parameter) The q optional parameter accepts a string as input and allows you to filter the request based on that string. Please note that search strings must be encoded according to ASCII. For example, \"john+investor@dealmaker.tech\" should be passed as “john%2Binvestor%40dealmaker.tech”. There are two main ways to filter with it. ## Keyword filtering Some keywords allow you to filter investors based on a specific “scope” of the investors, for example using the string “Invited” will filter all investors with the status invited, and the keyword “Has attachments” will filter investors with attachments. Here’s a list of possible keywords and the “scope” each one of the keywords filters by: | Keywords | Scope | Decoded Example | Encoded Example | | ---------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | Signed on \\(date range\\) | Investors who signed in the provided date range | Signed on (date range) [2020-07-01:2020-07-31] | `Signed%20on%20%28date%20range%29%20%5B2020-07-01%3A2020-07-31%5D` | | Enabled for countersignature on \\(date range\\) | Investors who were enabled for counter signature in the provided date range | Enabled for countersignature on (date range) [2022-05-24:2022-05-25] | `Enabled%20for%20countersignature%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Accepted on \\(date range\\) | Investors accepted in the provided date rage | Accepted on (date range) [2022-05-24:2022-05-25] | `Accepted%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Offline | Investors added to the deal offline | Offline | `Offline` | | Online | Investors added to the deal online | Online | `Online` | | Signed | Investors who signed their agreement | Signed | `Signed` | | Waiting for countersignature | Investors who have signed and are waiting for counter signature | Waiting for countersignature | `Waiting%20for%20countersignature` | | Invited | Investors on the Invited Status | Invited | `Invited` | | Accepted | Investors in the Accepted Status | Accepted | `Accepted` | | Questionnaire in progress | All Investors who have not finished completing the questionnaire | Questionnaire in progress | `Questionnaire%20in%20progress` | | Has attachments | All Investors with attachments | Has attachments | `Has%20attachments` | | Has notes | All Investors with notes | Has notes | `Has%20notes` | | Waiting for co-signature | Investors who have signed and are waiting for co-signature | Waiting for co-signature | `Waiting%20for%20co-signature` | | Background Check Approved | Investors with approved background check | Background Check Approved | `Background%20Check%20Approved` | | Document Review Pending | Investors with pending review | Document Review Pending | `Document%20Review%20Pending` | | Document Upload Pending | Investors with pending documents to upload | Document Upload Pending | `Document%20Upload%20Pending` | | Required adjudicator review | Investors who are required to be review by the adjudicator | Required adjudicator review | `Required%20adjudicator%20review` | --- **NOTE** Filtering keywords are case sensitive and need to be encoded --- ## Search String Any value for the parameter which does not match one of the keywords listed above, will use fields like `first name`, `last name`, `email`, `tags` to search for the investor. For example, if you search “Robert”, because this does not match one of the keywords listed above, it will then return any investors who have the string “Robert” in their name, email, or tags fields. # Versioning The latest version is v1. The version can be updated on the `Accept` header, just set the version as stated on the following example: ``` Accept:application/vnd.dealmaker-v1+json ``` | Version | Accept Header | | ------- | ----------------------------------- | | `v1` | application/vnd.dealmaker-`v1`+json | # SDK’s For instruction on installing SDKs, please view the following links - [Javascript](https://github.com/DealMakerTech/api/tree/main/v1/clients/javascript) - [Ruby](https://github.com/DealMakerTech/api/tree/main/v1/clients/ruby) # Webhooks Our webhooks functionality allows clients to automatically receive updates on a deal's investor data. Some of the data that the webhooks include: - Investor Name - Date created - Email - Phone - Allocation - Attachments - Accredited investor status - Accredited investor category - State (Draft, Invited, Signed, Accepted, Waiting, Inactive) Via webhooks clients can subscribe to the following events as they happen on Dealmaker: - Investor is created - Investor details are updated (any of the investor details above change or are updated) - Investor has signed their agreement - Invertor fully funded their investment - Investor has been accepted - Investor is deleted A URL supplied by the client will receive all the events with the information as part of the payload. Clients are able to add and update the URL within DealMaker. ## Configuration For a comprehensive guide on how to configure Webhooks please visit our support article: [Configuring Webhooks on DealMaker – DealMaker Support](https://help.dealmaker.tech/configuring-webhooks-on-dealmaker). As a developer user on DealMaker, you are able to configure webhooks by following the steps below: 1. Sign into Dealmaker 2. Go to **“Your profile”** in the top right corner 3. Access an **“Integrations”** configuration via the left menu 4. The developer configures webhooks by including: - The HTTPS URL where the request will be sent - Optionally, a security token that we would use to build a SHA1 hash that would be included in the request headers. The name of the header is `X-DealMaker-Signature`. If the secret is not specified, the hash won’t be included in the headers. - The Deal(s) to include in the webhook subscription - An email address that will be used to notify about errors. 5. The developers can disable webhooks temporarily if needed ## Specification ### Events The initial set of events will be related to the investor. The events are: 1. `investor.created` - Triggers every time a new investor is added to a deal 2. `investor.updated` - Triggers on updates to any of the following fields: - Status - Name - Email - (this is a user field so we trigger event for all investors with webhook subscription) - Allocated Amount - Investment Amount - Accredited investor fields - Adding or removing attachments - Tags - When the investor status is signed, the payload also includes a link to the signed document; the link expires after 30 minutes 3. `investor.signed` - Triggers when the investor signs their subscription agreement (terms and conditions) - When this happens the investor.state becomes `signed` - This event includes the same fields as the `investor.updated` event 4. `investor.funded` - Triggers when the investor becomes fully funded - This happens when the investor.funded_state becomes `funded` - This event includes the same fields as the `investor.updated` event 5. `investor.accepted` - Triggers when the investor is countersigned - When this happens the investor.state becomes `accepted` - This event includes the same fields as the `investor.updated` event 6. `investor.deleted` - Triggers when the investor is removed from the deal - The investor key of the payload only includes investor ID - The deal is not included in the payload. Due to our implementation it’s impossible to retrieve the deal the investor was part of ### Requests - The request is a `POST` - The payload’s `content-type` is `application/json` - Only `2XX` responses are considered successful. In the event of a different response, we consider it failed and queue the event for retry - We retry the request five times, after the initial attempt. Doubling the waiting time between intervals with each try. The first retry happens after 30 seconds, then 60 seconds, 2 mins, 4 minutes, and 8 minutes. This timing scheme gives the receiver about 1 hour if all the requests fail - If an event fails all the attempts to be delivered, we send an email to the address that the user configured ### Payload #### Common Properties There will be some properties that are common to all the events on the system. | Key | Type | Description | | ----------------- | ------ | -------------------------------------------------------------------------------------- | | event | String | The event that triggered the call | | event_id | String | A unique identifier for the event | | deal<sup>\\*</sup> | Object | The deal in which the event occurred. please see below for an example on the deal object<sup>\\*\\*</sup> | <sup>\\*</sup>This field is not included when deleting a resource <sup>\\*\\*</sup> Sample Deal Object in the webhook payload ```json \"deal\": { \"id\": 0, \"title\": \"string\", \"created_at\": \"2022-12-06T18:14:44.000Z\", \"updated_at\": \"2022-12-08T12:46:48.000Z\", \"state\": \"string\", \"currency\": \"string\", \"security_type\": \"string\", \"price_per_security\": 0.00, \"deal_type\": \"string\", \"minimum_investment\": 0, \"maximum_investment\": 0, \"issuer\": { \"id\": 0, \"name\": \"string\" }, \"enterprise\": { \"id\": 0, \"name\": \"string\" } } ``` #### Common Properties (investor scope) By design, we have incorporated on the webhooks payload the same investor-related fields included in the Investor model, for reference on the included fields, their types and values please click [here](https://docs.dealmaker.tech/#tag/investor_model). This will allow you to get all the necessary information you need about a particular investor without having to call the Get Investor by ID endpoint. | #### Investor State Here is a brief description of each investor state: - **Draft:** the investor is added to the platform but hasn't been invited yet and cannot access the portal - **Invited:** the investor was added to the platform but hasn’t completed the questionnaire - **Signed:** the investor signed the document (needs approval from Lawyer or Reviewer before countersignature) - **Waiting:** the investor was approved for countersignature by any of the Lawyers or Reviewers in the deal - **Accepted:** the investor's agreement was countersigned by the Signatory - **Inactive** the investor is no longer eligible to participate in the offering. This may be because their warrant expired, they requested a refund, or they opted out of the offering #### Update Delay Given the high number of updates our platform performs on any investor, we’ve added a cool down period on update events that allows us to “group” updates and trigger only one every minute. In consequence, update events will be delivered 1 minute after the initial request was made and will include the latest version of the investor data at delivery time.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.75.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for DealMakerAPI::CampaignApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'CampaignApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = DealMakerAPI::CampaignApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of CampaignApi' do
|
30
|
+
it 'should create an instance of CampaignApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(DealMakerAPI::CampaignApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for get_ttw_campaign
|
36
|
+
# Gets a TTW campaign for a given company
|
37
|
+
# Gets a TTW campaign for a given company
|
38
|
+
# @param id
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [V1EntitiesTtwCampaignResponse]
|
41
|
+
describe 'get_ttw_campaign test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
end
|
@@ -63,4 +63,10 @@ describe DealMakerAPI::V1EntitiesDealsProgressPageSummaryItem do
|
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
66
|
+
describe 'test attribute "link_label"' do
|
67
|
+
it 'should work' do
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
66
72
|
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
=begin
|
2
|
+
#DealMaker API
|
3
|
+
|
4
|
+
## Introduction Welcome to DealMaker’s Web API v1! This API is RESTful, easy to integrate with, and offers support in 2 different languages. This is the technical documentation for our API. There are tutorials and examples of integrations with our API available on our [knowledge centre](https://help.dealmaker.tech/training-centre) as well. # Libraries - Javascript - Ruby # Authentication To authenticate, add an Authorization header to your API request that contains an access token. Before you [generate an access token](#how-to-generate-an-access-token) your must first [create an application](#create-an-application) on your portal and retrieve the your client ID and secret ## Create an Application DealMaker’s Web API v1 supports the use of OAuth applications. Applications can be generated in your [account](https://app.dealmaker.tech/developer/applications). To create an API Application, click on your user name in the top right corner to open a dropdown menu, and select \"Integrations\". Under the API settings tab, click the `Create New Application` button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-1.png) Name your application and assign the level of permissions for this application ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-2.png) Once your application is created, save in a secure space your client ID and secret. **WARNING**: The secret key will not be visible after you click the close button ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-3.png) From the developer tab, you will be able to view and manage all the available applications ![Screenshot](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/api-application-4.png) Each Application consists of a client id, secret and set of scopes. The scopes define what resources you want to have access to. The client ID and secret are used to generate an access token. You will need to create an application to use API endpoints. ## How to generate an access token After creating an application, you must make a call to obtain a bearer token using the Generate an OAuth token operation. This operation requires the following parameters: `token endpoint` - https://app.dealmaker.tech/oauth/token `grant_type` - must be set to `client_credentials` `client_id` - the Client ID displayed when you created the OAuth application in the previous step `client_secret` - the Client Secret displayed when you created the OAuth application in the previous step `scope` - the scope is established when you created the OAuth application in the previous step Note: The Generate an OAuth token response specifies how long the bearer token is valid for. You should reuse the bearer token until it is expired. When the token is expired, call Generate an OAuth token again to generate a new one. To use the access token, you must set a plain text header named `Authorization` with the contents of the header being “Bearer XXX” where XXX is your generated access token. ### Example #### Postman Here's an example on how to generate the access token with Postman, where `{{CLIENT_ID}}` and `{{CLIENT_SECRET}}` are the values generated after following the steps on [Create an Application](#create-an-application) ![Get access token postman example](https://s3.ca-central-1.amazonaws.com/docs.dealmaker.tech/images/token-postman.png) # Status Codes ## Content-Type Header All responses are returned in JSON format. We specify this by sending the Content-Type header. ## Status Codes Below is a table containing descriptions of the various status codes we currently support against various resources. Sometimes your API call will generate an error. Here you will find additional information about what to expect if you don’t format your request properly, or we fail to properly process your request. | Status Code | Description | | ----------- | ----------- | | `200` | Success | | `403` | Forbidden | | `404` | Not found | # Pagination Pagination is used to divide large responses is smaller portions (pages). By default, all endpoints return a maximum of 25 records per page. You can change the number of records on a per request basis by passing a `per_page` parameter in the request header parameters. The largest supported `per_page` parameter is 100. When the response exceeds the `per_page` parameter, you can paginate through the records by increasing the `offset` parameter. Example: `offset=25` will return 25 records starting from 26th record. You may also paginate using the `page` parameter to indicate the page number you would like to show on the response. Please review the table below for the input parameters ## Inputs | Parameter | Description | | ---------- | ------------------------------------------------------------------------------- | | `per_page` | Amount of records included on each page (Default is 25) | | `page` | Page number | | `offset` | Amount of records offset on the API request where 0 represents the first record | ## Response Headers | Response Header | Description | | --------------- | -------------------------------------------- | | `X-Total` | Total number of records of response | | `X-Total-Pages` | Total number of pages of response | | `X-Per-Page` | Total number of records per page of response | | `X-Page` | Number of current page | | `X-Next-Page` | Number of next page | | `X-Prev-Page` | Number of previous page | | `X-Offset` | Total number of records offset | # Search and Filtering (The q parameter) The q optional parameter accepts a string as input and allows you to filter the request based on that string. Please note that search strings must be encoded according to ASCII. For example, \"john+investor@dealmaker.tech\" should be passed as “john%2Binvestor%40dealmaker.tech”. There are two main ways to filter with it. ## Keyword filtering Some keywords allow you to filter investors based on a specific “scope” of the investors, for example using the string “Invited” will filter all investors with the status invited, and the keyword “Has attachments” will filter investors with attachments. Here’s a list of possible keywords and the “scope” each one of the keywords filters by: | Keywords | Scope | Decoded Example | Encoded Example | | ---------------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | | Signed on \\(date range\\) | Investors who signed in the provided date range | Signed on (date range) [2020-07-01:2020-07-31] | `Signed%20on%20%28date%20range%29%20%5B2020-07-01%3A2020-07-31%5D` | | Enabled for countersignature on \\(date range\\) | Investors who were enabled for counter signature in the provided date range | Enabled for countersignature on (date range) [2022-05-24:2022-05-25] | `Enabled%20for%20countersignature%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Accepted on \\(date range\\) | Investors accepted in the provided date rage | Accepted on (date range) [2022-05-24:2022-05-25] | `Accepted%20on%20(date%20range)%20%5B2022-05-24%3A2022-05-25%5D` | | Offline | Investors added to the deal offline | Offline | `Offline` | | Online | Investors added to the deal online | Online | `Online` | | Signed | Investors who signed their agreement | Signed | `Signed` | | Waiting for countersignature | Investors who have signed and are waiting for counter signature | Waiting for countersignature | `Waiting%20for%20countersignature` | | Invited | Investors on the Invited Status | Invited | `Invited` | | Accepted | Investors in the Accepted Status | Accepted | `Accepted` | | Questionnaire in progress | All Investors who have not finished completing the questionnaire | Questionnaire in progress | `Questionnaire%20in%20progress` | | Has attachments | All Investors with attachments | Has attachments | `Has%20attachments` | | Has notes | All Investors with notes | Has notes | `Has%20notes` | | Waiting for co-signature | Investors who have signed and are waiting for co-signature | Waiting for co-signature | `Waiting%20for%20co-signature` | | Background Check Approved | Investors with approved background check | Background Check Approved | `Background%20Check%20Approved` | | Document Review Pending | Investors with pending review | Document Review Pending | `Document%20Review%20Pending` | | Document Upload Pending | Investors with pending documents to upload | Document Upload Pending | `Document%20Upload%20Pending` | | Required adjudicator review | Investors who are required to be review by the adjudicator | Required adjudicator review | `Required%20adjudicator%20review` | --- **NOTE** Filtering keywords are case sensitive and need to be encoded --- ## Search String Any value for the parameter which does not match one of the keywords listed above, will use fields like `first name`, `last name`, `email`, `tags` to search for the investor. For example, if you search “Robert”, because this does not match one of the keywords listed above, it will then return any investors who have the string “Robert” in their name, email, or tags fields. # Versioning The latest version is v1. The version can be updated on the `Accept` header, just set the version as stated on the following example: ``` Accept:application/vnd.dealmaker-v1+json ``` | Version | Accept Header | | ------- | ----------------------------------- | | `v1` | application/vnd.dealmaker-`v1`+json | # SDK’s For instruction on installing SDKs, please view the following links - [Javascript](https://github.com/DealMakerTech/api/tree/main/v1/clients/javascript) - [Ruby](https://github.com/DealMakerTech/api/tree/main/v1/clients/ruby) # Webhooks Our webhooks functionality allows clients to automatically receive updates on a deal's investor data. Some of the data that the webhooks include: - Investor Name - Date created - Email - Phone - Allocation - Attachments - Accredited investor status - Accredited investor category - State (Draft, Invited, Signed, Accepted, Waiting, Inactive) Via webhooks clients can subscribe to the following events as they happen on Dealmaker: - Investor is created - Investor details are updated (any of the investor details above change or are updated) - Investor has signed their agreement - Invertor fully funded their investment - Investor has been accepted - Investor is deleted A URL supplied by the client will receive all the events with the information as part of the payload. Clients are able to add and update the URL within DealMaker. ## Configuration For a comprehensive guide on how to configure Webhooks please visit our support article: [Configuring Webhooks on DealMaker – DealMaker Support](https://help.dealmaker.tech/configuring-webhooks-on-dealmaker). As a developer user on DealMaker, you are able to configure webhooks by following the steps below: 1. Sign into Dealmaker 2. Go to **“Your profile”** in the top right corner 3. Access an **“Integrations”** configuration via the left menu 4. The developer configures webhooks by including: - The HTTPS URL where the request will be sent - Optionally, a security token that we would use to build a SHA1 hash that would be included in the request headers. The name of the header is `X-DealMaker-Signature`. If the secret is not specified, the hash won’t be included in the headers. - The Deal(s) to include in the webhook subscription - An email address that will be used to notify about errors. 5. The developers can disable webhooks temporarily if needed ## Specification ### Events The initial set of events will be related to the investor. The events are: 1. `investor.created` - Triggers every time a new investor is added to a deal 2. `investor.updated` - Triggers on updates to any of the following fields: - Status - Name - Email - (this is a user field so we trigger event for all investors with webhook subscription) - Allocated Amount - Investment Amount - Accredited investor fields - Adding or removing attachments - Tags - When the investor status is signed, the payload also includes a link to the signed document; the link expires after 30 minutes 3. `investor.signed` - Triggers when the investor signs their subscription agreement (terms and conditions) - When this happens the investor.state becomes `signed` - This event includes the same fields as the `investor.updated` event 4. `investor.funded` - Triggers when the investor becomes fully funded - This happens when the investor.funded_state becomes `funded` - This event includes the same fields as the `investor.updated` event 5. `investor.accepted` - Triggers when the investor is countersigned - When this happens the investor.state becomes `accepted` - This event includes the same fields as the `investor.updated` event 6. `investor.deleted` - Triggers when the investor is removed from the deal - The investor key of the payload only includes investor ID - The deal is not included in the payload. Due to our implementation it’s impossible to retrieve the deal the investor was part of ### Requests - The request is a `POST` - The payload’s `content-type` is `application/json` - Only `2XX` responses are considered successful. In the event of a different response, we consider it failed and queue the event for retry - We retry the request five times, after the initial attempt. Doubling the waiting time between intervals with each try. The first retry happens after 30 seconds, then 60 seconds, 2 mins, 4 minutes, and 8 minutes. This timing scheme gives the receiver about 1 hour if all the requests fail - If an event fails all the attempts to be delivered, we send an email to the address that the user configured ### Payload #### Common Properties There will be some properties that are common to all the events on the system. | Key | Type | Description | | ----------------- | ------ | -------------------------------------------------------------------------------------- | | event | String | The event that triggered the call | | event_id | String | A unique identifier for the event | | deal<sup>\\*</sup> | Object | The deal in which the event occurred. please see below for an example on the deal object<sup>\\*\\*</sup> | <sup>\\*</sup>This field is not included when deleting a resource <sup>\\*\\*</sup> Sample Deal Object in the webhook payload ```json \"deal\": { \"id\": 0, \"title\": \"string\", \"created_at\": \"2022-12-06T18:14:44.000Z\", \"updated_at\": \"2022-12-08T12:46:48.000Z\", \"state\": \"string\", \"currency\": \"string\", \"security_type\": \"string\", \"price_per_security\": 0.00, \"deal_type\": \"string\", \"minimum_investment\": 0, \"maximum_investment\": 0, \"issuer\": { \"id\": 0, \"name\": \"string\" }, \"enterprise\": { \"id\": 0, \"name\": \"string\" } } ``` #### Common Properties (investor scope) By design, we have incorporated on the webhooks payload the same investor-related fields included in the Investor model, for reference on the included fields, their types and values please click [here](https://docs.dealmaker.tech/#tag/investor_model). This will allow you to get all the necessary information you need about a particular investor without having to call the Get Investor by ID endpoint. | #### Investor State Here is a brief description of each investor state: - **Draft:** the investor is added to the platform but hasn't been invited yet and cannot access the portal - **Invited:** the investor was added to the platform but hasn’t completed the questionnaire - **Signed:** the investor signed the document (needs approval from Lawyer or Reviewer before countersignature) - **Waiting:** the investor was approved for countersignature by any of the Lawyers or Reviewers in the deal - **Accepted:** the investor's agreement was countersigned by the Signatory - **Inactive** the investor is no longer eligible to participate in the offering. This may be because their warrant expired, they requested a refund, or they opted out of the offering #### Update Delay Given the high number of updates our platform performs on any investor, we’ve added a cool down period on update events that allows us to “group” updates and trigger only one every minute. In consequence, update events will be delivered 1 minute after the initial request was made and will include the latest version of the investor data at delivery time.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.75.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0-SNAPSHOT
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for DealMakerAPI::V1EntitiesTtwCampaignResponse
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe DealMakerAPI::V1EntitiesTtwCampaignResponse do
|
21
|
+
let(:instance) { DealMakerAPI::V1EntitiesTtwCampaignResponse.new }
|
22
|
+
|
23
|
+
describe 'test an instance of V1EntitiesTtwCampaignResponse' do
|
24
|
+
it 'should create an instance of V1EntitiesTtwCampaignResponse' do
|
25
|
+
# uncomment below to test the instance creation
|
26
|
+
#expect(instance).to be_instance_of(DealMakerAPI::V1EntitiesTtwCampaignResponse)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
describe 'test attribute "id"' do
|
31
|
+
it 'should work' do
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe 'test attribute "name"' do
|
37
|
+
it 'should work' do
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
describe 'test attribute "redirect_link"' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe 'test attribute "introduction_email"' do
|
49
|
+
it 'should work' do
|
50
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe 'test attribute "one_day_reminder_email"' do
|
55
|
+
it 'should work' do
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe 'test attribute "two_day_reminder_email"' do
|
61
|
+
it 'should work' do
|
62
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
describe 'test attribute "seven_day_reminder_email"' do
|
67
|
+
it 'should work' do
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe 'test attribute "confirmation_email"' do
|
73
|
+
it 'should work' do
|
74
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: DealMakerAPI
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.105.
|
4
|
+
version: 0.105.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DealMaker
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -64,6 +64,7 @@ files:
|
|
64
64
|
- docs/Add506cDocumentRequest.md
|
65
65
|
- docs/AddDocumentRequest.md
|
66
66
|
- docs/BulkUploadInvestorsRequest.md
|
67
|
+
- docs/CampaignApi.md
|
67
68
|
- docs/CompanyApi.md
|
68
69
|
- docs/CountryApi.md
|
69
70
|
- docs/CreateBulkUploadDetailRequest.md
|
@@ -197,6 +198,7 @@ files:
|
|
197
198
|
- docs/V1EntitiesShareholdersTags.md
|
198
199
|
- docs/V1EntitiesState.md
|
199
200
|
- docs/V1EntitiesSubscriptionAgreement.md
|
201
|
+
- docs/V1EntitiesTtwCampaignResponse.md
|
200
202
|
- docs/V1EntitiesUser.md
|
201
203
|
- docs/V1EntitiesUsersBinding.md
|
202
204
|
- docs/V1EntitiesUsersFactor.md
|
@@ -212,6 +214,7 @@ files:
|
|
212
214
|
- docs/VerifySmsVerificationRequest.md
|
213
215
|
- git_push.sh
|
214
216
|
- lib/DealMakerAPI.rb
|
217
|
+
- lib/DealMakerAPI/api/campaign_api.rb
|
215
218
|
- lib/DealMakerAPI/api/company_api.rb
|
216
219
|
- lib/DealMakerAPI/api/country_api.rb
|
217
220
|
- lib/DealMakerAPI/api/custom_emails_api.rb
|
@@ -351,6 +354,7 @@ files:
|
|
351
354
|
- lib/DealMakerAPI/models/v1_entities_shareholders_tags.rb
|
352
355
|
- lib/DealMakerAPI/models/v1_entities_state.rb
|
353
356
|
- lib/DealMakerAPI/models/v1_entities_subscription_agreement.rb
|
357
|
+
- lib/DealMakerAPI/models/v1_entities_ttw_campaign_response.rb
|
354
358
|
- lib/DealMakerAPI/models/v1_entities_user.rb
|
355
359
|
- lib/DealMakerAPI/models/v1_entities_users_binding.rb
|
356
360
|
- lib/DealMakerAPI/models/v1_entities_users_factor.rb
|
@@ -365,6 +369,7 @@ files:
|
|
365
369
|
- lib/DealMakerAPI/models/verify_factor_request.rb
|
366
370
|
- lib/DealMakerAPI/models/verify_sms_verification_request.rb
|
367
371
|
- lib/DealMakerAPI/version.rb
|
372
|
+
- spec/api/campaign_api_spec.rb
|
368
373
|
- spec/api/company_api_spec.rb
|
369
374
|
- spec/api/country_api_spec.rb
|
370
375
|
- spec/api/custom_emails_api_spec.rb
|
@@ -501,6 +506,7 @@ files:
|
|
501
506
|
- spec/models/v1_entities_shareholders_tags_spec.rb
|
502
507
|
- spec/models/v1_entities_state_spec.rb
|
503
508
|
- spec/models/v1_entities_subscription_agreement_spec.rb
|
509
|
+
- spec/models/v1_entities_ttw_campaign_response_spec.rb
|
504
510
|
- spec/models/v1_entities_user_spec.rb
|
505
511
|
- spec/models/v1_entities_users_binding_spec.rb
|
506
512
|
- spec/models/v1_entities_users_factor_spec.rb
|
@@ -542,6 +548,7 @@ test_files:
|
|
542
548
|
- spec/api/country_api_spec.rb
|
543
549
|
- spec/api/deals_api_spec.rb
|
544
550
|
- spec/api/investor_api_spec.rb
|
551
|
+
- spec/api/campaign_api_spec.rb
|
545
552
|
- spec/api/user_api_spec.rb
|
546
553
|
- spec/api/shareholder_api_spec.rb
|
547
554
|
- spec/api/company_api_spec.rb
|
@@ -607,6 +614,7 @@ test_files:
|
|
607
614
|
- spec/models/create_deal_setup_request_spec.rb
|
608
615
|
- spec/models/v1_entities_beefree_access_token_spec.rb
|
609
616
|
- spec/models/v1_entities_company_deal_spec.rb
|
617
|
+
- spec/models/v1_entities_ttw_campaign_response_spec.rb
|
610
618
|
- spec/models/v1_entities_shareholders_tags_spec.rb
|
611
619
|
- spec/models/add506c_document_request_spec.rb
|
612
620
|
- spec/models/v1_entities_investor_profile_fields_trust_spec.rb
|