(Vault.Consumers)
Create a consumer
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
var res = await sdk.Vault.Consumers.CreateAsync(
consumer: new ConsumerInput() {
ConsumerId = "test_consumer_id",
Metadata = new ConsumerMetadata() {
AccountName = "SpaceX",
UserName = "Elon Musk",
Email = "elon@musk.com",
Image = "https://www.spacex.com/static/images/share.jpg",
},
},
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
Consumer |
ConsumerInput |
✔️ |
N/A |
|
AppId |
string |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
VaultConsumersAddResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |
This endpoint includes all application consumers, along with an aggregated count of requests made.
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
using ApideckUnifySdk.Models.Requests;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
VaultConsumersAllResponse? res = await sdk.Vault.Consumers.ListAsync(
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
cursor: "<value>",
limit: 20
);
while(res != null)
{
// handle items
res = await res.Next!();
}
Parameter |
Type |
Required |
Description |
Example |
AppId |
string |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
Cursor |
string |
➖ |
Cursor to start from. You can find cursors for next/previous pages in the meta.cursors property of the response. |
|
Limit |
long |
➖ |
Number of results to return. Minimum 1, Maximum 200, Default 20 |
|
VaultConsumersAllResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |
Consumer detail including their aggregated counts with the connections they have authorized.
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
var res = await sdk.Vault.Consumers.GetAsync(
consumerId: "test_user_id",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
ConsumerId |
string |
✔️ |
ID of the consumer to return |
test_user_id |
AppId |
string |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
VaultConsumersOneResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |
Update consumer metadata such as name and email.
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
var res = await sdk.Vault.Consumers.UpdateAsync(
consumerId: "test_user_id",
updateConsumerRequest: new UpdateConsumerRequest() {
Metadata = new ConsumerMetadata() {
AccountName = "SpaceX",
UserName = "Elon Musk",
Email = "elon@musk.com",
Image = "https://www.spacex.com/static/images/share.jpg",
},
},
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
ConsumerId |
string |
✔️ |
ID of the consumer to return |
test_user_id |
UpdateConsumerRequest |
UpdateConsumerRequest |
✔️ |
N/A |
|
AppId |
string |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
VaultConsumersUpdateResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |
Delete consumer and all their connections, including credentials.
using ApideckUnifySdk;
using ApideckUnifySdk.Models.Components;
var sdk = new Apideck(
apiKey: "<YOUR_BEARER_TOKEN_HERE>",
consumerId: "test-consumer",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
var res = await sdk.Vault.Consumers.DeleteAsync(
consumerId: "test_user_id",
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX"
);
// handle response
Parameter |
Type |
Required |
Description |
Example |
ConsumerId |
string |
✔️ |
ID of the consumer to return |
test_user_id |
AppId |
string |
➖ |
The ID of your Unify application |
dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX |
VaultConsumersDeleteResponse
Error Type |
Status Code |
Content Type |
ApideckUnifySdk.Models.Errors.BadRequestResponse |
400 |
application/json |
ApideckUnifySdk.Models.Errors.UnauthorizedResponse |
401 |
application/json |
ApideckUnifySdk.Models.Errors.PaymentRequiredResponse |
402 |
application/json |
ApideckUnifySdk.Models.Errors.NotFoundResponse |
404 |
application/json |
ApideckUnifySdk.Models.Errors.UnprocessableResponse |
422 |
application/json |
ApideckUnifySdk.Models.Errors.APIException |
4XX, 5XX |
*/* |