PUT user/…/upgrade

PUT Upgrades a basic user account to a premium account. This call can only be used to upgrade the own user account. It requires a payment token.

Resource URL

https://www.drillster.com/api/2/user/{user_id}/upgrade

Parameters

Field Description
user_id
required

The user ID of the account to be upgraded. Instead of the user ID, the value self may also be used.

payment_provider
required

A code indicating which party has provided the payment.

Possible values: DRILLSTER, APPLE, GOOGLE

payment_key
required

The code that is proof of payment.

Example value: UVW8J-4D7DV-QSPMN-WRSDS-ERJ7Q

If a PUT request has no body (i.e. the body is empty), it is still mandatory to include a Content-Length header (i.e. Content-Length: 0). Not all HTTP clients do this automatically. For more information, please see RFC 2616.

Response

A 2.0 User object reflecting the newly upgraded status.

Example request

POST https://www.drillster.com/api/2/upgrade
payment_provider=DRILLSTER
payment_key=UVW8J-4D7DV-QSPMN-WRSDS-ERJ7Q

Error responses

The following error situations are possible:

ID Description
missing_parameters No payment provider and key were provided.
unsupported_payment_provider The given payment provider is not supported
invalid_payment The given payment key could not be verified as a valid payment.
already_upgraded This user already has a premium account.