Skip to content

Yoast/my-yoast-php-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

my-yoast-php-client

The MyYoast Api

This PHP package is automatically generated by the Swagger Codegen project:

  • API version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.php.PhpClientCodegen

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/yoast/my-yoast-php-client.git"
    }
  ],
  "require": {
    "yoast/my-yoast-php-client": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/my-yoast-php-client/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

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

$apiInstance = new Yoast\MyYoastApiClient\Api\AccountsApi(
    // 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()
);
$body = new \Yoast\MyYoastApiClient\Model\UsernameCheckRequestDto(); // \Yoast\MyYoastApiClient\Model\UsernameCheckRequestDto | 
$xAccountAppSharedSecret = "xAccountAppSharedSecret_example"; // string | The API shared secret

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

$apiInstance = new Yoast\MyYoastApiClient\Api\AccountsApi(
    // 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()
);
$body = new \Yoast\MyYoastApiClient\Model\TOTPTwoFactorConfigDto(); // \Yoast\MyYoastApiClient\Model\TOTPTwoFactorConfigDto | 
$xAccountAppSharedSecret = "xAccountAppSharedSecret_example"; // string | The API shared secret
$id = "38400000-8cf0-11bd-b23e-10b96e4ef00d"; // string | 

try {
    $apiInstance->setTOTPTwoFactorConfig($body, $xAccountAppSharedSecret, $id);
} catch (Exception $e) {
    echo 'Exception when calling AccountsApi->setTOTPTwoFactorConfig: ', $e->getMessage(), PHP_EOL;
}
?>

Documentation for API Endpoints

All URIs are relative to http://my.yoast.test:3000

Class Method HTTP request Description
AccountsApi checkUsername GET /api/accounts/checkUsername Username availability check
AccountsApi setTOTPTwoFactorConfig POST /api/accounts/{id}/TOTPTwoFactorConfig
AdmissionApi changeStudent PUT /api/Admissions/{id} Update an admission
AdmissionApi getMany GET /api/Admissions Get admissions
AdmissionApi getManyPaged GET /api/Admissions/paged Get admissions
AdmissionApi getOne GET /api/Admissions/{id} Get an admission
AdmissionApi invite POST /api/Admissions Invite a customer
AdmissionApi transferAdmissions POST /api/Admissions/transfer Transfer admissions between customers
AuthApi getAccessTokenWithoutWordPress POST /api/Customers/login Log in a user on MyYoast.
AuthApi loginUser POST /api/Customers/login-user
AuthApi logoutUser POST /api/Customers/logout-user Logout the user on Yoast.com.
AuthApi logoutWithoutWordPress GET /logout
AuthApi yoastComCallback GET /auth/yoast/callback
AuthApi yoastComLogin GET /auth/yoast
AuthenticationApi getAccessToken GET /api/auth/{id}/getAccessToken
AuthenticationApi getProfile GET /api/profile
AuthenticationApi impersonate POST /api/auth/{id}/impersonate
AuthenticationApi login POST /api/auth/login
BlacklistApi createOne POST /api/Blacklist Creates a blacklisted site
BlacklistApi deleteOne DELETE /api/Blacklist/{id} Remove a site from the blacklist
BlacklistApi getMany GET /api/Blacklist Gets blacklisted sites
BlacklistApi getManyPaged GET /api/Blacklist/paged Gets blacklisted sites
CloudflareApi purgeKVStore POST /api/cloudflare/kv/registered-domains/purge Purge kv pairs from the registered domains key value store in Cloudflare
CloudflareApi updateAll POST /api/cloudflare/kv/registered-domains/update-all Update sites in the registered domains key value store in Cloudflare
ComposerTokenApi disable POST /api/ComposerTokens/{id}/delete Disable a composer token
ComposerTokenApi generate POST /api/ComposerTokens/generate Generates a Composer token
ComposerTokenApi rename POST /api/ComposerTokens/{id}/rename Renames a Composer token
CourseApi fromAcademy PUT /api/Courses/fromAcademy Upserts a course
CourseApi getMany GET /api/Courses Get courses
CourseApi getOne GET /api/Courses/{id}
CourseEnrollmentApi bulkInvite POST /api/CourseEnrollments/bulkInvite Bulk invite for Course Enrollment.
CourseEnrollmentApi fromAcademy PUT /api/CourseEnrollments/fromAcademy Update a CourseEnrollment
CourseEnrollmentApi getLegacyExpiring GET /api/CourseEnrollments/getLegacyExpiring Get legacy course enrollments that expire between two given dates
CourseEnrollmentApi getMany GET /api/CourseEnrollments Get course enrollments
CourseEnrollmentApi getManyPaged GET /api/CourseEnrollments/paged Get customers
CourseEnrollmentApi getOne GET /api/CourseEnrollments/{id} Get a course enrollment
CourseEnrollmentApi invite POST /api/CourseEnrollments/{id}/invite Invite a customer
CourseEnrollmentApi transfer POST /api/CourseEnrollments/transfer Transfer course enrollments
CustomerApi activate POST /api/Customers/activate Activate the account of a user
CustomerApi addRole POST /api/Customers/{id}/roleMapping
CustomerApi cancelSubscription POST /api/Customers/{customerId}/subscriptions/{id}/cancel Cancel (part of) a subscription.
CustomerApi changePassword PATCH /api/Customers/{id}/password Update a customer's password in WordPress
CustomerApi createAccessToken POST /api/Customers/{id}/accessTokens Create an access token for a user
CustomerApi createAccount POST /api/Customers/create-account Creates an account for a customer on yoast.com without the signup flow.
CustomerApi createSite POST /api/Customers/{customerId}/sites Create a site for a user
CustomerApi current GET /api/Customers/current Get the current customer
CustomerApi deleteCustomer DELETE /api/Customers/{id}/gdpr-delete Performs a &quot;GDPR forget me&quot; request.
CustomerApi deleteRole DELETE /api/Customers/{id}/roleMapping
CustomerApi downloadProfile GET /api/Customers/{id}/download Download profile.
CustomerApi enable POST /api/Customers/{id}/enable Enables the customer with the given ID
CustomerApi findRefunds GET /api/Customers/{id}/findRefunds Find refunds for user
CustomerApi getAllRoles GET /api/Customers/allroles Get all existing roles with their ID.
CustomerApi getBuyerCourseEnrollments GET /api/Customers/{customerId}/buyerCourseEnrollments Find Course Enrollments that a customer is buyer of
CustomerApi getCourseAccessList GET /api/Customers/academyCourseAccessList/{sourceId} Academy Course access
CustomerApi getCourseAccessListByCustomerId GET /api/Customers/academyCourseAccessListByCustomerId/{customerId} Academy Course access
CustomerApi getCourseEnrollments GET /api/Customers/{customerId}/courseEnrollments Find Course Enrollments
CustomerApi getCustomersWithRole GET /api/Customers/rolemapping-ids Get the ids of all customers with at least one role.
CustomerApi getMany GET /api/Customers/{customerId}/composerTokens Get composer tokens
CustomerApi getManyPaged GET /api/Customers/paged Get customers
CustomerApi getMany_0 GET /api/Customers/{customerId}/subscriptions Get subscriptions
CustomerApi getMany_1 GET /api/Customers/{customerId}/sites Get sites
CustomerApi getMany_2 GET /api/Customers/{customerId}/orders Get orders
CustomerApi getMany_3 GET /api/Customers/{id}/roles
CustomerApi getMany_4 GET /api/Customers/{customerId}/identities Get user identities
CustomerApi getMany_5 GET /api/Customers Get customers
CustomerApi getOne GET /api/Customers/{customerId}/composerTokens/{id} Get a composer token
CustomerApi getOne_0 GET /api/Customers/{customerId}/subscriptions/{id} Get a subscriptions
CustomerApi getOne_1 GET /api/Customers/{customerId}/sites/{id} Get a site
CustomerApi getOne_2 GET /api/Customers/{customerId}/orders/{id} Get a order
CustomerApi getOne_3 GET /api/Customers/{id} Get a customer
CustomerApi getStudentCourseEnrollments GET /api/Customers/{customerId}/studentCourseEnrollments Find Course Enrollments that a customer is student in
CustomerApi patchProfile PATCH /api/Customers/{id}/profile Update a customer to WordPress
CustomerApi profile GET /api/Customers/{id}/profile
CustomerApi resetPassword PATCH /api/Customers/resetPassword Reset the user's password.
CustomerApi sendResetPasswordEmail POST /api/Customers/sendResetPasswordEmail Send a reset password email to the user.
CustomerApi signup POST /api/Customers/signup Signup a customer on yoast.com following the normal signup flow.
CustomerApi status GET /api/Customers/{customerId}/newsletter Newsletter subscription status
CustomerApi subscribe POST /api/Customers/{customerId}/newsletter Subscribe to the newsletter
CustomerApi subscribeByEmail POST /api/Customers/newsletter/{list}/subscribe Subscribes a user to a newsletter
CustomerApi unsubscribe DELETE /api/Customers/{customerId}/newsletter Unsubscribe from the newsletter
CustomerApi updateOne PATCH /api/Customers/{id}
CustomerApi uploadAvatar POST /api/Customers/{id}/avatar Upload a new UserAvatar to WordPress
CustomerNoteApi createOne POST /api/CustomerNotes
CustomerNoteApi deleteOne DELETE /api/CustomerNotes/{id}
CustomerNoteApi getMany GET /api/CustomerNotes Get customer notes
CustomerNoteApi getOne GET /api/CustomerNotes/{id} Get a customer note
DefaultApi checkHealth POST /api/tmp
DownloadApi downloadFile GET /api/downloads/file/{name} Route to download a file
DownloadApi uploadFile POST /api/downloads/file/{name} Route to update a file.
EDDApi handleGetRequest GET /edd-sl-api Activate or deactivate a site license
EDDApi handlePostRequest POST /edd-sl-api
EmailApi sendEmails POST /api/Emails/bulk-send
ExportOrdersApi exportOrders GET /export-orders/{year}/{month}/{type} Creates an export for orders
ExportOrdersApi exportOrdersV2 GET /export-orders/v2/{from}/{to}/{type} Creates an export for orders
FromWooCommerceApi customerFromWooCommerce PUT /api/Customers/fromWooCommerce Update or create a customer
FromWooCommerceApi orderFromWooCommerce PUT /api/Orders/fromWooCommerce Sync orders to MyYoast.
FromWooCommerceApi productFromWooCommerce PUT /api/Products/fromWooCommerce Sync products to MyYoast.
FromWooCommerceApi productGroupFromWooCommerce PUT /api/ProductGroups/fromWooCommerce Sync products to MyYoast.
GDPRApi deleteCustomer DELETE /api/Customers/{id}/gdpr-delete Performs a &quot;GDPR forget me&quot; request.
HelpscoutApi helpscout POST /helpscout Get information about a customer
MailingListApi checkGetRoute GET /api/Mailing-list/newsletter/tZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyK
MailingListApi getStatus GET /api/Mailing-list/status Get the subscription status.
MailingListApi isSubscribedToNewsletter GET /api/Mailing-list/isSubscribedToNewsletter Get the subscription status.
MailingListApi mailChimpWebhook POST /api/Mailing-list/newsletter/tZhjyjwsYFUMPzNNhJaVADZZIrixRSbXOFgptZJyyK Entry point for the mailchimp webhooks
MailingListApi mailblueWebhook POST /api/Mailing-list/newsletter/wALazNYUBfqZIeUDiqyzETbLdbkODeTCjKokMKcbJV Entry point for the mailblue webhooks
MailingListApi removeContactCustomField DELETE /api/Mailing-list/fieldValue Delete contact tags and/or fields.
MailingListApi setContactCustomField POST /api/Mailing-list/fieldValue Update contact tags and/or fields.
MailingListApi setContactTag POST /api/Mailing-list/contactTag Update contact tags and/or fields.
MailingListApi subscribe POST /api/Mailing-list/subscribe Subscribe contact to a mailing list.
MailingListApi subscribeToNewsletter POST /api/Mailing-list/subscribeToNewsletter Subscribe contact to the newsletter.
MailingListApi unsubscribe POST /api/Mailing-list/unsubscribe Unsubscribe to a mailing list.
MailingListApi unsubscribeFromNewsletter POST /api/Mailing-list/unsubscribeFromNewsletter Unsubscribe to a mailing list.
OrderApi export GET /api/Orders/export Get orders
OrderApi getAutoRenewalCount GET /api/Orders/auto-renewal-count
OrderApi getMany GET /api/Orders Get orders
OrderApi getManyPaged GET /api/Orders/paged Get orders
OrderApi getOne GET /api/Orders/{id} Get a order
OrderApi getOneByInvoice GET /api/Orders/InvoiceNumber/{invoiceNumber} Get a order by invoiceNumber
OrderApi getProductGroupsByInvoice GET /api/Orders/productGroups/{invoiceNumber} Get productGroups by invoiceNumber
OrderApi invoice GET /api/Orders/{id}/invoice Create invoice
OrderApi refundInvoice GET /api/Orders/{id}/refunds/{refundId}/invoice Creates a credit note
PackagesApi serveArchiveZIP GET /packages/dist/{org}/{name}/{archive}.zip Serves an .zip of the plugin.
PackagesApi servePackagesJSON GET /packages/packages.json Serves the general packages.json file.
PackagesApi serveProvider2JSON GET /packages/p2/{org}/{name}.json Serves the requested provider.json
PackagesApi serveProviderJSON GET /packages/p/{org}/{nameAndHash}.json Serves the requested provider.json
ProductApi deleteOne DELETE /api/Products/{productId}
ProductApi getMany GET /api/Products Get products
ProductApi getOne GET /api/Products/{id} Get a product
ProductApi pluginVersionDetails GET /api/Products/wordpressPluginVersionDetails
ProductGroupApi getMany GET /api/ProductGroups Get productgroups
ProductGroupApi updateDownload PATCH /api/ProductGroups/updateDownload Update the download
ProductSwitchApi invoice GET /api/ProductSwitch/{id}/invoice Create invoice
ProductSwitchApi revert GET /api/ProductSwitch/{id}/revert Create invoice
ProvisionerApi getMany GET /api/ProvisionerData Get provisioner data
ProvisionerApi getOne GET /api/ProvisionerData/{id} Get provisioner data
ProvisioningAccountApi setSiteForSubscription POST /api/provisioning/account/regenerate-token Generate a new auth token
ProvisioningDownloadsApi currentVersion GET /api/provisioning/downloads/currentVersion Retrieve the current version for the productCode for the provisioner.
ProvisioningDownloadsApi currentZip GET /api/provisioning/downloads/currentZip Redirect to the current zip for the productCode.
ProvisioningUsersApi scheduleDelete POST /api/provisioning/user/schedule-delete Schedule a delete for a subscription
RefundApi export GET /api/Refunds/export Get refunds
RefundApi getMany GET /api/Refunds Get refunds
RefundApi getOne GET /api/Refunds/{id} Get a refund
RobotsApi serveRobots GET /robots.txt
ServerCheckApi checkHealth GET /server-check Server health check
SiteApi addSubscription PUT /api/Sites/{id}/subscriptions Adds a subscription to a site
SiteApi current GET /api/Sites/current Get the current connected site for an access token.
SiteApi currentClone GET /api/Sites/info Get the current connected site for an access token.
SiteApi deleteOne DELETE /api/Sites/{id}
SiteApi getMany GET /api/Sites Get sites
SiteApi getManyPaged GET /api/Sites/paged Get sites
SiteApi getOne GET /api/Sites/{id} Get a site
SiteApi getSiteStatus GET /api/Sites/getSiteStatus Get a urls HTTP status
SiteApi index POST /api/Sites/index
SiteApi removeSubscription DELETE /api/Sites/{id}/subscriptions/{subscriptionId} Removes a subscription from a site
SiteApi switchSubscription POST /api/Sites/switchSubscription Switches the subscription for a number of times.
SiteApi switchSubscriptionNumberOfTimes POST /api/Sites/switchSubscriptionNumberOfTimes Switches the subscription for a number of times.
SiteApi updateOne PATCH /api/Sites/{id}
SiteApi updateSiteUrl PATCH /api/Sites/{id}/url
SubscriptionApi calculateExpansionPrice GET /api/Subscriptions/calculateExpansionPrice/{id}/{subscriptionNumber} Calculate expansion price
SubscriptionApi deleteOne DELETE /api/Subscriptions/{id} Delete a subscription
SubscriptionApi forceCancel POST /api/Subscriptions/{id}/force-cancel Forcefully cancel a subscription
SubscriptionApi getExpiringSubscriptions GET /api/Subscriptions/expiring
SubscriptionApi getMany GET /api/Subscriptions Get subscriptions
SubscriptionApi getManyPaged GET /api/Subscriptions/paged Get subscriptions
SubscriptionApi getMutations GET /api/Subscriptions/{id}/mutations Get all subscription mutation events
SubscriptionApi getOne GET /api/Subscriptions/{id} Get a subscription
SubscriptionApi getOneAsEntity GET /api/Subscriptions/{id}/asEntity Get a subscription
SubscriptionApi getProductSwitchOptions GET /api/Subscriptions/{id}/product-switch-options Fetch product switch options
SubscriptionApi linkSite POST /api/Subscriptions/link-site Link a subscription to provided site URL
SubscriptionApi recalculateSubscriptionCount POST /api/Subscriptions/{id}/recalculateSubscriptionCount Recalculate SubscriptionCount.
SubscriptionApi renew GET /api/Subscriptions/renew/{subscriptionNumber}/{secretKey} Renew subscriptions
SubscriptionApi setExpiryDate POST /api/Subscriptions/setExpiryDate Set Date.
SubscriptionApi switchPaymentMethod GET /api/Subscriptions/switchPaymentMethod/{id}/{subscriptionNumber}
SubscriptionApi switchProduct POST /api/Subscriptions/{id}/switch-product Switch to another product
SubscriptionApi transferOwnership POST /api/Subscriptions/transfer Transfer subscription ownership
SubscriptionApi upgrade GET /api/Subscriptions/upgrade/{subscriptionNumber}/{secretKey} Upgrade subscriptions
SubscriptionProvisioningApi cancelSubscription POST /api/provisioning/subscriptions/{id}/cancel Cancel a single subscription
SubscriptionProvisioningApi create POST /api/provisioning/subscriptions/create Create a subscription
SubscriptionProvisioningApi getOne GET /api/provisioning/subscriptions/{id} Get a subscription
SubscriptionProvisioningApi refundSubscription POST /api/provisioning/subscriptions/{id}/refund Refund a single subscription
SubscriptionProvisioningApi renewSubscription POST /api/provisioning/subscriptions/{id}/renew Renew a subscription
SubscriptionProvisioningApi setSiteForSubscription POST /api/provisioning/subscriptions/{id}/set-site Link a subscription to a site
WorkerApi addJob POST /api/Worker/job
WorkerApi getJob GET /api/Worker/job/{id}
WorkerApi getRecurringJobs GET /api/Worker/getRecurringJobs
WorkerApi getRecurringJobsInfo GET /api/Worker/getRecurringJobs/{name}
WorkerApi getScheduledJobs GET /api/Worker/getScheduledJobs/{name}
WorkerApi removeAllJobsWithName DELETE /api/Worker/jobsByName/{name}
WorkerApi removeJob DELETE /api/Worker/job/{id}
WorkerApi replaceJob POST /api/Worker/job/replace

Documentation For Models

Documentation For Authorization

bearer

  • Type: HTTP bearer authentication

Author

About

An auto-generated PHP Client for My Yoast

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published