Skip to content

Latest commit

 

History

History
402 lines (273 loc) · 11.7 KB

UserApi.md

File metadata and controls

402 lines (273 loc) · 11.7 KB

EConnect\Psb\UserApi

All URIs are relative to http://localhost, except if the operation defines another base path.

Method HTTP request Description
addOrUpdateUser() PUT /api/v1/user Add or update users.
addOrUpdateUserParty() PUT /api/v1/user/{name}/party Add or update user's party.
deleteUser() DELETE /api/v1/user/{name} Delete user.
deleteUserParty() DELETE /api/v1/user/{name}/party/{partyId} Removes user's party.
getUserParties() GET /api/v1/user/{name}/party Get user's parties.
getUsers() GET /api/v1/user List users.

addOrUpdateUser()

addOrUpdateUser($user): \EConnect\Psb\Model\User

Add or update users.

Add users. Use the userId if you want to update.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Subscription-Key
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKey('Subscription-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Subscription-Key', 'Bearer');

// Configure OAuth2 access token for authorization: Bearer
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new EConnect\Psb\Api\UserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$user = new \EConnect\Psb\Model\User(); // \EConnect\Psb\Model\User | The user that will be added or updated.

try {
    $result = $apiInstance->addOrUpdateUser($user);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->addOrUpdateUser: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
user \EConnect\Psb\Model\User The user that will be added or updated. [optional]

Return type

\EConnect\Psb\Model\User

Authorization

Subscription-Key, Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

addOrUpdateUserParty()

addOrUpdateUserParty($name, $user_party): \EConnect\Psb\Model\UserParty

Add or update user's party.

Adds or updates the party permission to the user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Subscription-Key
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKey('Subscription-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Subscription-Key', 'Bearer');

// Configure OAuth2 access token for authorization: Bearer
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new EConnect\Psb\Api\UserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$name = 'name_example'; // string
$user_party = new \EConnect\Psb\Model\UserParty(); // \EConnect\Psb\Model\UserParty

try {
    $result = $apiInstance->addOrUpdateUserParty($name, $user_party);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->addOrUpdateUserParty: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
name string
user_party \EConnect\Psb\Model\UserParty

Return type

\EConnect\Psb\Model\UserParty

Authorization

Subscription-Key, Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteUser()

deleteUser($name)

Delete user.

Delete a user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Subscription-Key
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKey('Subscription-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Subscription-Key', 'Bearer');

// Configure OAuth2 access token for authorization: Bearer
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new EConnect\Psb\Api\UserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$name = 'name_example'; // string | The name for the user.

try {
    $apiInstance->deleteUser($name);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->deleteUser: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
name string The name for the user.

Return type

void (empty response body)

Authorization

Subscription-Key, Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteUserParty()

deleteUserParty($name, $party_id)

Removes user's party.

Removes party permissions from user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Subscription-Key
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKey('Subscription-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Subscription-Key', 'Bearer');

// Configure OAuth2 access token for authorization: Bearer
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new EConnect\Psb\Api\UserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$name = 'name_example'; // string
$party_id = 'party_id_example'; // string

try {
    $apiInstance->deleteUserParty($name, $party_id);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->deleteUserParty: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
name string
party_id string

Return type

void (empty response body)

Authorization

Subscription-Key, Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUserParties()

getUserParties($name): \EConnect\Psb\Model\UserParty[]

Get user's parties.

Get the parties that belong to the user.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Subscription-Key
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKey('Subscription-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Subscription-Key', 'Bearer');

// Configure OAuth2 access token for authorization: Bearer
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new EConnect\Psb\Api\UserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$name = 'name_example'; // string

try {
    $result = $apiInstance->getUserParties($name);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->getUserParties: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
name string

Return type

\EConnect\Psb\Model\UserParty[]

Authorization

Subscription-Key, Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUsers()

getUsers(): \EConnect\Psb\Model\User[]

List users.

Get users that in your context. (Only for PsbManager)

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure API key authorization: Subscription-Key
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKey('Subscription-Key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = EConnect\Psb\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Subscription-Key', 'Bearer');

// Configure OAuth2 access token for authorization: Bearer
$config = EConnect\Psb\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new EConnect\Psb\Api\UserApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

try {
    $result = $apiInstance->getUsers();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling UserApi->getUsers: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\EConnect\Psb\Model\User[]

Authorization

Subscription-Key, Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]