Client
class Client extends BaseClient
Client class.
This class is responsible for querying Contentful's Content Management API.
Traits
Constants
URI_MANAGEMENT |
The default URI to which all requests should be made. |
URI_UPLOAD |
The special URI for uploading files. |
Methods
Returns a ResourceArray object containing Organization resources.
No description
Returns a DeliveryApiKey resource.
Returns a ResourceArray object containing DeliveryApiKey objects.
Returns an Asset resource.
Returns a ResourceArray object which contains Asset resources.
Returns a ContentTypeSnapshot resource.
Returns a ResourceArray object which contains ContentTypeSnapshot resources.
Returns an EditorInterface resource.
Returns a ContentType resource.
Returns a ResourceArray object which contains ContentType resources.
Returns a published ContentType resource.
Returns a ResourceArray object which contains published ContentType resources.
Returns an EntrySnapshot resource.
Returns a ResourceArray object which contains EntrySnapshot resources.
Returns an Entry resource.
Returns a ResourceArray object which contains Entry resources.
Returns an Extension resource.
Returns a ResourceArray object containing Extension resources.
Returns a Locale resource.
Returns a ResourceArray object containing Locale resources.
Returns a proxy to an environment resource.
Returns an Environment resource.
Returns a ResourceArray object which contains Environment resources.
Returns a PreviewApiKey resource.
Returns a ResourceArray object containing PreviewApiKey resources.
Returns a ResourceArray object containing Role resources.
Returns a SpaceMembership resource.
Returns a ResourceArray object containing SpaceMembership resources.
Returns a WebhookCall resource.
Returns a ResourceArray object containing WebhookCall resources.
Returns an WebhookHealth resource.
Returns a ResourceArray object containing Webhook resources.
Returns a PersonalAccessToken resource.
Returns a ResourceArray object containing PersonalAccessToken resources.
Client constructor.
Returns the active ResourceBuilder instance.
{@inheritdoc}
Persists the current resource in the given scope.
Make an API request using the given resource.
Resolves a link to a Contentful resource.
Resolves a collection of links to a Contentful resources.
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Details
in OrganizationExtension at line 33
getOrganizations(Query $query = null)
Returns a ResourceArray object containing Organization resources.
at line 241
ResourceInterface|ResourceArray
fetchResource(string $class, array $parameters, Query $query = null, ResourceInterface $resource = null)
in DeliveryApiKeyExtension at line 33
getDeliveryApiKey(string $spaceId, string $deliveryApiKeyId)
Returns a DeliveryApiKey resource.
in DeliveryApiKeyExtension at line 46
getDeliveryApiKeys(string $spaceId, Query $query = null)
Returns a ResourceArray object containing DeliveryApiKey objects.
in AssetExtension at line 33
getAsset(string $spaceId, string $environmentId, string $assetId)
Returns an Asset resource.
in AssetExtension at line 47
getAssets(string $spaceId, string $environmentId, Query $query = null)
Returns a ResourceArray object which contains Asset resources.
in ContentTypeSnapshotExtension at line 33
getContentTypeSnapshot(string $spaceId, string $environmentId, string $contentTypeId, string $snapshotId)
Returns a ContentTypeSnapshot resource.
in ContentTypeSnapshotExtension at line 48
getContentTypeSnapshots(string $spaceId, string $environmentId, string $contentTypeId, Query $query = null)
Returns a ResourceArray object which contains ContentTypeSnapshot resources.
in EditorInterfaceExtension at line 33
getEditorInterface(string $spaceId, string $environmentId, string $contentTypeId)
Returns an EditorInterface resource.
in ContentTypeExtension at line 37
getContentType(string $spaceId, string $environmentId, string $contentTypeId)
Returns a ContentType resource.
in ContentTypeExtension at line 51
getContentTypes(string $spaceId, string $environmentId, Query $query = null)
Returns a ResourceArray object which contains ContentType resources.
in ContentTypeExtension at line 64
getPublishedContentType(string $spaceId, string $environmentId, string $contentTypeId)
Returns a published ContentType resource.
in ContentTypeExtension at line 78
getPublishedContentTypes(string $spaceId, string $environmentId, Query $query = null)
Returns a ResourceArray object which contains published ContentType resources.
in EntrySnapshotExtension at line 33
getEntrySnapshot(string $spaceId, string $environmentId, string $entryId, string $snapshotId)
Returns an EntrySnapshot resource.
in EntrySnapshotExtension at line 48
getEntrySnapshots(string $spaceId, string $environmentId, string $entryId, Query $query = null)
Returns a ResourceArray object which contains EntrySnapshot resources.
in EntryExtension at line 35
getEntry(string $spaceId, string $environmentId, string $entryId)
Returns an Entry resource.
in EntryExtension at line 49
getEntries(string $spaceId, string $environmentId, Query $query = null)
Returns a ResourceArray object which contains Entry resources.
in ExtensionExtension at line 33
getExtension(string $spaceId, string $environmentId, string $extensionId)
Returns an Extension resource.
in ExtensionExtension at line 47
getExtensions(string $spaceId, string $environmentId)
Returns a ResourceArray object containing Extension resources.
in LocaleExtension at line 33
getLocale(string $spaceId, string $environmentId, string $localeId)
Returns a Locale resource.
in LocaleExtension at line 47
getLocales(string $spaceId, string $environmentId)
Returns a ResourceArray object containing Locale resources.
in EnvironmentExtension at line 39
getEnvironmentProxy(string $spaceId, string $environmentId = 'master')
Returns a proxy to an environment resource.
Useful for all environment-scoped operations.
in EnvironmentExtension at line 49
getEnvironment(string $spaceId, string $environmentId)
Returns an Environment resource.
in EnvironmentExtension at line 62
getEnvironments(string $spaceId, Query $query = null)
Returns a ResourceArray object which contains Environment resources.
in PreviewApiKeyExtension at line 33
getPreviewApiKey(string $spaceId, string $previewApiKeyId)
Returns a PreviewApiKey resource.
in PreviewApiKeyExtension at line 46
getPreviewApiKeys(string $spaceId, Query $query = null)
Returns a ResourceArray object containing PreviewApiKey resources.
in RoleExtension at line 33
getRole(string $spaceId, string $roleId)
Returns a Role resource.
in RoleExtension at line 46
getRoles(string $spaceId, Query $query = null)
Returns a ResourceArray object containing Role resources.
in SpaceMembershipExtension at line 33
getSpaceMembership(string $spaceId, string $spaceMembershipId)
Returns a SpaceMembership resource.
in SpaceMembershipExtension at line 46
getSpaceMemberships(string $spaceId, Query $query = null)
Returns a ResourceArray object containing SpaceMembership resources.
in UploadExtension at line 33
getUpload(string $spaceId, string $uploadId)
Returns an Upload resource.
in WebhookCallExtension at line 33
getWebhookCall(string $spaceId, string $webhookId, string $webhookCallId)
Returns a WebhookCall resource.
in WebhookCallExtension at line 47
getWebhookCalls(string $spaceId, string $webhookId, Query $query = null)
Returns a ResourceArray object containing WebhookCall resources.
in WebhookHealthExtension at line 33
getWebhookHealth(string $spaceId, string $webhookId)
Returns an WebhookHealth resource.
in WebhookExtension at line 36
getWebhook(string $spaceId, string $webhookId)
Returns a Webhook resource.
in WebhookExtension at line 49
getWebhooks(string $spaceId, Query $query = null)
Returns a ResourceArray object containing Webhook resources.
in SpaceExtension at line 41
getSpaceProxy(string $spaceId)
Returns a proxy to a space resource.
Useful for all space-scoped operations.
in SpaceExtension at line 51
getSpace(string $spaceId)
Returns a Space resource.
in SpaceExtension at line 63
getSpaces(Query $query = null)
Returns a ResourceArray object containing Space objects.
in PersonalAccessTokenExtension at line 33
getPersonalAccessToken(string $personalAccessTokenId)
Returns a PersonalAccessToken resource.
in PersonalAccessTokenExtension at line 45
getPersonalAccessTokens(Query $query = null)
Returns a ResourceArray object containing PersonalAccessToken resources.
in UserExtension at line 35
getUserMe()
Returns a User resource.
at line 92
__construct(string $accessToken, array $options = [])
Client constructor.
at line 111
getBuilder()
Returns the active ResourceBuilder instance.
at line 119
request(string $method, string $uri, array $options = [])
{@inheritdoc}
at line 189
create(CreatableInterface $resource, string $resourceId = '', ResourceInterface|string[] $parameters = [])
Persists the current resource in the given scope.
You can use this method in 2 ways.
Creating using an actual resource object
// $environment is an instance of Contentful\Management\Resource\Environment
$client->create($entry, $environment);
Creating using an array with the required IDs
$client->create($entry, $entryCustomId, ['space' => $spaceId, 'environment' => $environmentId]);
at line 217
ResourceInterface|ResourceArray|null
requestWithResource(ResourceInterface $resource, string $method, string $path = '', array $options = [])
Make an API request using the given resource.
The object will be used to infer the API endpoint.
at line 265
resolveLink(Link $link, array $parameters = [])
Resolves a link to a Contentful resource.
at line 276
resolveLinkCollection(array $links, array $parameters = [])
Resolves a collection of links to a Contentful resources.
at line 284
getApi()
{@inheritdoc}
at line 292
protected
getExceptionNamespace()
{@inheritdoc}
at line 300
static protected
getSdkName()
{@inheritdoc}
at line 308
static protected
getPackageName()
{@inheritdoc}
at line 316
static protected
getApiContentType()
{@inheritdoc}