Client
class Client extends BaseClient
Client class.
This class is responsible for querying Contentful's Content Management API.
Traits
Constants
VERSION |
The current version of the SDK. |
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 an Upload resource.
Returns a WebhookCall resource.
Returns a ResourceArray object containing WebhookCall resources.
Returns an WebhookHealth resource.
Returns a Webhook 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.
No description
Persists the current resource in the given scope.
Make an API request using the given resource.
Resolves a link to a Contentful resource.
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Details
in OrganizationExtension at line 35
ResourceArray
getOrganizations(Query $query = null)
Returns a ResourceArray object containing Organization resources.
at line 205
ResourceInterface|ResourceArray
fetchResource(string $class, array $parameters, Query $query = null, ResourceInterface $resource = null)
in DeliveryApiKeyExtension at line 36
DeliveryApiKey
getDeliveryApiKey(string $spaceId, string $deliveryApiKeyId)
Returns a DeliveryApiKey resource.
in DeliveryApiKeyExtension at line 54
ResourceArray
getDeliveryApiKeys(string $spaceId, Query $query = null)
Returns a ResourceArray object containing DeliveryApiKey objects.
in AssetExtension at line 38
Asset
getAsset(string $spaceId, string $environmentId, string $assetId)
Returns an Asset resource.
in AssetExtension at line 58
ResourceArray
getAssets(string $spaceId, string $environmentId, Query $query = null)
Returns a ResourceArray object which contains Asset resources.
in ContentTypeSnapshotExtension at line 38
ContentTypeSnapshot
getContentTypeSnapshot(string $spaceId, string $environmentId, string $contentTypeId, string $snapshotId)
Returns a ContentTypeSnapshot resource.
in ContentTypeSnapshotExtension at line 60
ResourceArray
getContentTypeSnapshots(string $spaceId, string $environmentId, string $contentTypeId, Query $query = null)
Returns a ResourceArray object which contains ContentTypeSnapshot resources.
in EditorInterfaceExtension at line 35
EditorInterface
getEditorInterface(string $spaceId, string $environmentId, string $contentTypeId)
Returns an EditorInterface resource.
in ContentTypeExtension at line 41
ContentType
getContentType(string $spaceId, string $environmentId, string $contentTypeId)
Returns a ContentType resource.
in ContentTypeExtension at line 61
ResourceArray
getContentTypes(string $spaceId, string $environmentId, Query $query = null)
Returns a ResourceArray object which contains ContentType resources.
in ContentTypeExtension at line 80
ContentType
getPublishedContentType(string $spaceId, string $environmentId, string $contentTypeId)
Returns a published ContentType resource.
in ContentTypeExtension at line 100
ResourceArray
getPublishedContentTypes(string $spaceId, string $environmentId, Query $query = null)
Returns a ResourceArray object which contains published ContentType resources.
in EntrySnapshotExtension at line 38
EntrySnapshot
getEntrySnapshot(string $spaceId, string $environmentId, string $entryId, string $snapshotId)
Returns an EntrySnapshot resource.
in EntrySnapshotExtension at line 60
ResourceArray
getEntrySnapshots(string $spaceId, string $environmentId, string $entryId, Query $query = null)
Returns a ResourceArray object which contains EntrySnapshot resources.
in EntryExtension at line 39
Entry
getEntry(string $spaceId, string $environmentId, string $entryId)
Returns an Entry resource.
in EntryExtension at line 59
ResourceArray
getEntries(string $spaceId, string $environmentId, Query $query = null)
Returns a ResourceArray object which contains Entry resources.
in ExtensionExtension at line 36
Extension
getExtension(string $spaceId, string $environmentId, string $extensionId)
Returns an Extension resource.
in ExtensionExtension at line 55
ResourceArray
getExtensions(string $spaceId, string $environmentId)
Returns a ResourceArray object containing Extension resources.
in LocaleExtension at line 36
Locale
getLocale(string $spaceId, string $environmentId, string $localeId)
Returns a Locale resource.
in LocaleExtension at line 55
ResourceArray
getLocales(string $spaceId, string $environmentId)
Returns a ResourceArray object containing Locale resources.
in EnvironmentExtension at line 42
EnvironmentProxy
getEnvironmentProxy(string $spaceId, string $environmentId = 'master')
Returns a proxy to an environment resource.
Useful for all environment-scoped operations.
in EnvironmentExtension at line 57
Environment
getEnvironment(string $spaceId, string $environmentId)
Returns an Environment resource.
in EnvironmentExtension at line 75
ResourceArray
getEnvironments(string $spaceId, Query $query = null)
Returns a ResourceArray object which contains Environment resources.
in PreviewApiKeyExtension at line 36
PreviewApiKey
getPreviewApiKey(string $spaceId, string $previewApiKeyId)
Returns a PreviewApiKey resource.
in PreviewApiKeyExtension at line 54
ResourceArray
getPreviewApiKeys(string $spaceId, Query $query = null)
Returns a ResourceArray object containing PreviewApiKey resources.
in RoleExtension at line 36
Role
getRole(string $spaceId, string $roleId)
Returns a Role resource.
in RoleExtension at line 54
ResourceArray
getRoles(string $spaceId, Query $query = null)
Returns a ResourceArray object containing Role resources.
in SpaceMembershipExtension at line 36
SpaceMembership
getSpaceMembership(string $spaceId, string $spaceMembershipId)
Returns a SpaceMembership resource.
in SpaceMembershipExtension at line 54
ResourceArray
getSpaceMemberships(string $spaceId, Query $query = null)
Returns a ResourceArray object containing SpaceMembership resources.
in UploadExtension at line 34
Upload
getUpload(string $spaceId, string $uploadId)
Returns an Upload resource.
in WebhookCallExtension at line 37
WebhookCall
getWebhookCall(string $spaceId, string $webhookId, string $webhookCallId)
Returns a WebhookCall resource.
in WebhookCallExtension at line 57
ResourceArray
getWebhookCalls(string $spaceId, string $webhookId, Query $query = null)
Returns a ResourceArray object containing WebhookCall resources.
in WebhookHealthExtension at line 34
WebhookHealth
getWebhookHealth(string $spaceId, string $webhookId)
Returns an WebhookHealth resource.
in WebhookExtension at line 39
Webhook
getWebhook(string $spaceId, string $webhookId)
Returns a Webhook resource.
in WebhookExtension at line 57
ResourceArray
getWebhooks(string $spaceId, Query $query = null)
Returns a ResourceArray object containing Webhook resources.
in SpaceExtension at line 43
SpaceProxy
getSpaceProxy(string $spaceId)
Returns a proxy to a space resource.
Useful for all space-scoped operations.
in SpaceExtension at line 57
Space
getSpace(string $spaceId)
Returns a Space resource.
in SpaceExtension at line 73
ResourceArray
getSpaces(Query $query = null)
Returns a ResourceArray object containing Space objects.
in PersonalAccessTokenExtension at line 35
PersonalAccessToken
getPersonalAccessToken(string $personalAccessTokenId)
Returns a PersonalAccessToken resource.
in PersonalAccessTokenExtension at line 51
ResourceArray
getPersonalAccessTokens(Query $query = null)
Returns a ResourceArray object containing PersonalAccessToken resources.
in UserExtension at line 33
User
getUserMe()
Returns a User resource.
at line 75
__construct(string $accessToken, array $options = [])
Client constructor.
at line 93
ResourceBuilder
getBuilder()
Returns the active ResourceBuilder instance.
at line 110
ResourceInterface|ResourceArray|null
makeRequest(string $method, string $path, array $options = [], ResourceInterface $resource = null)
at line 153
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 181
ResourceInterface|ResourceArray|null
requestWithResource(ResourceInterface $resource, string $method, string $path = '', array $options = [], bool $hydrateResource = true)
Make an API request using the given resource.
The object will be used to infer the API endpoint.
at line 228
ResourceInterface
resolveLink(Link $link, array $parameters = [])
Resolves a link to a Contentful resource.
at line 313
getApi()
{@inheritdoc}
at line 321
protected
getExceptionNamespace()
{@inheritdoc}
at line 329
protected
getSdkName()
{@inheritdoc}
at line 337
protected
getSdkVersion()
{@inheritdoc}
at line 345
protected
getApiContentType()
{@inheritdoc}