Skip to content

MailSlurp\ApiUserControllerApi

All URIs are relative to https://php.api.mailslurp.com.

Method HTTP request Description
getJsonPropertyAsString() POST /user/json/pluck
getUserInfo() GET /user/info

getJsonPropertyAsString()

getJsonPropertyAsString($property, $body): string

Utility function to extract properties from JSON objects in language where this is cumbersome.

Example

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


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiApiUserControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);
$property = 'property_example'; // string | JSON property name or dot separated path selector such as `a.b.c`
$body = new stdClass; // object

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

Parameters

Name Type Description Notes
property string JSON property name or dot separated path selector such as a.b.c
body object

Return type

string

Authorization

API_KEY

HTTP request headers

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

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

getUserInfo()

getUserInfo(): MailSlurpModelsUserInfoDto

Example

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


// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');


$apiInstance = new MailSlurpApiApiUserControllerApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
    // This is optional, `GuzzleHttpClient` will be used as default.
    new GuzzleHttpClient(),
    $config
);

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

Parameters

This endpoint does not need any parameter.

Return type

MailSlurpModelsUserInfoDto

Authorization

API_KEY

HTTP request headers

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

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