Skip to content

Commit dd4b03c

Browse files
authored
Merge pull request #6 from sendinblue/feature_promises-based-api
Promises based APIs
2 parents ae075c2 + 0229e51 commit dd4b03c

File tree

751 files changed

+5005
-26280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

751 files changed

+5005
-26280
lines changed

Diff for: README.md

+68-161
Large diffs are not rendered by default.

Diff for: docs/AccountApi.md

100755100644
+12-13
Original file line numberDiff line numberDiff line change
@@ -9,37 +9,36 @@ Method | HTTP request | Description
99

1010
<a name="getAccount"></a>
1111
# **getAccount**
12-
> InlineResponse200 getAccount()
12+
> GetAccount getAccount()
1313
1414
Get your account informations, plans and credits details
1515

1616
### Example
1717
```javascript
18-
var SendinBlueApi = require('sendinblue-apiv3');
18+
var SendinBlueApi = require('sendin_blue_api');
1919
var defaultClient = SendinBlueApi.ApiClient.instance;
2020

2121
// Configure API key authorization: api-key
22-
var apiKey = defaultClient.authentications['api-key'];
23-
apiKey.apiKey = 'YOUR API KEY';
22+
var api-key = defaultClient.authentications['api-key'];
23+
api-key.apiKey = 'YOUR API KEY';
24+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
25+
//api-key.apiKeyPrefix = 'Token';
2426

2527
var apiInstance = new SendinBlueApi.AccountApi();
28+
apiInstance.getAccount().then(function(data) {
29+
console.log('API called successfully. Returned data: ' + data);
30+
}, function(error) {
31+
console.error(error);
32+
});
2633

27-
var callback = function(error, data, response) {
28-
if (error) {
29-
console.error(error);
30-
} else {
31-
console.log('API called successfully. Returned data: ' + data);
32-
}
33-
};
34-
apiInstance.getAccount(callback);
3534
```
3635

3736
### Parameters
3837
This endpoint does not need any parameter.
3938

4039
### Return type
4140

42-
[**InlineResponse200**](InlineResponse200.md)
41+
[**GetAccount**](GetAccount.md)
4342

4443
### Authorization
4544

Diff for: docs/AddCredits.md

100755100644
File mode changed.

Diff for: docs/AddCredits1.md

-9
This file was deleted.

Diff for: docs/AddRemoveContactToList.md

100755100644
File mode changed.

Diff for: docs/AttributesApi.md

100755100644
+36-39
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,42 @@ Method | HTTP request | Description
1111

1212
<a name="createAttribute"></a>
1313
# **createAttribute**
14-
> InlineResponse201 createAttribute(createAttribute)
14+
> CreateModel createAttribute(createAttribute)
1515
1616
Creates contact attributes
1717

1818
### Example
1919
```javascript
20-
var SendinBlueApi = require('sendinblue-apiv3');
20+
var SendinBlueApi = require('sendin_blue_api');
2121
var defaultClient = SendinBlueApi.ApiClient.instance;
2222

2323
// Configure API key authorization: api-key
24-
var apiKey = defaultClient.authentications['api-key'];
25-
apiKey.apiKey = 'YOUR API KEY';
24+
var api-key = defaultClient.authentications['api-key'];
25+
api-key.apiKey = 'YOUR API KEY';
26+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
27+
//api-key.apiKeyPrefix = 'Token';
2628

2729
var apiInstance = new SendinBlueApi.AttributesApi();
2830

29-
var createAttribute = new SendinBlueApi.CreateAttribute1(); // CreateAttribute1 | Values to create an attribute
31+
var createAttribute = new SendinBlueApi.CreateAttribute(); // CreateAttribute | Values to create an attribute
3032

33+
apiInstance.createAttribute(createAttribute).then(function(data) {
34+
console.log('API called successfully. Returned data: ' + data);
35+
}, function(error) {
36+
console.error(error);
37+
});
3138

32-
var callback = function(error, data, response) {
33-
if (error) {
34-
console.error(error);
35-
} else {
36-
console.log('API called successfully. Returned data: ' + data);
37-
}
38-
};
39-
apiInstance.createAttribute(createAttribute, callback);
4039
```
4140

4241
### Parameters
4342

4443
Name | Type | Description | Notes
4544
------------- | ------------- | ------------- | -------------
46-
**createAttribute** | [**CreateAttribute1**](CreateAttribute1.md)| Values to create an attribute |
45+
**createAttribute** | [**CreateAttribute**](CreateAttribute.md)| Values to create an attribute |
4746

4847
### Return type
4948

50-
[**InlineResponse201**](InlineResponse201.md)
49+
[**CreateModel**](CreateModel.md)
5150

5251
### Authorization
5352

@@ -66,26 +65,25 @@ Deletes an attribute
6665

6766
### Example
6867
```javascript
69-
var SendinBlueApi = require('sendinblue-apiv3');
68+
var SendinBlueApi = require('sendin_blue_api');
7069
var defaultClient = SendinBlueApi.ApiClient.instance;
7170

7271
// Configure API key authorization: api-key
73-
var apiKey = defaultClient.authentications['api-key'];
74-
apiKey.apiKey = 'YOUR API KEY';
72+
var api-key = defaultClient.authentications['api-key'];
73+
api-key.apiKey = 'YOUR API KEY';
74+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
75+
//api-key.apiKeyPrefix = 'Token';
7576

7677
var apiInstance = new SendinBlueApi.AttributesApi();
7778

7879
var attributeId = "attributeId_example"; // String | id of the attribute
7980

81+
apiInstance.deleteAttribute(attributeId).then(function() {
82+
console.log('API called successfully.');
83+
}, function(error) {
84+
console.error(error);
85+
});
8086

81-
var callback = function(error, data, response) {
82-
if (error) {
83-
console.error(error);
84-
} else {
85-
console.log('API called successfully.');
86-
}
87-
};
88-
apiInstance.deleteAttribute(attributeId, callback);
8987
```
9088

9189
### Parameters
@@ -109,37 +107,36 @@ null (empty response body)
109107

110108
<a name="getAttributes"></a>
111109
# **getAttributes**
112-
> InlineResponse20016 getAttributes()
110+
> GetAttributes getAttributes()
113111
114112
Lists all attributes
115113

116114
### Example
117115
```javascript
118-
var SendinBlueApi = require('sendinblue-apiv3');
116+
var SendinBlueApi = require('sendin_blue_api');
119117
var defaultClient = SendinBlueApi.ApiClient.instance;
120118

121119
// Configure API key authorization: api-key
122-
var apiKey = defaultClient.authentications['api-key'];
123-
apiKey.apiKey = 'YOUR API KEY';
120+
var api-key = defaultClient.authentications['api-key'];
121+
api-key.apiKey = 'YOUR API KEY';
122+
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
123+
//api-key.apiKeyPrefix = 'Token';
124124

125125
var apiInstance = new SendinBlueApi.AttributesApi();
126+
apiInstance.getAttributes().then(function(data) {
127+
console.log('API called successfully. Returned data: ' + data);
128+
}, function(error) {
129+
console.error(error);
130+
});
126131

127-
var callback = function(error, data, response) {
128-
if (error) {
129-
console.error(error);
130-
} else {
131-
console.log('API called successfully. Returned data: ' + data);
132-
}
133-
};
134-
apiInstance.getAttributes(callback);
135132
```
136133

137134
### Parameters
138135
This endpoint does not need any parameter.
139136

140137
### Return type
141138

142-
[**InlineResponse20016**](InlineResponse20016.md)
139+
[**GetAttributes**](GetAttributes.md)
143140

144141
### Authorization
145142

Diff for: docs/ContactEmails.md

-8
This file was deleted.

Diff for: docs/ContactEmails1.md

-8
This file was deleted.

0 commit comments

Comments
 (0)