Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.55 KB

setting-backups-ftp-credentials.md

File metadata and controls

43 lines (30 loc) · 1.55 KB

Setting Jetpack Backups FTP credentials

There are two ways to set Jetpack Backups FTP credentials. One way of doing this is during plan provisioning. The second one is by calling the /jpphp/{blog_id}/ftp-credentials endpoint directly. This document explains the latter.

Getting an access token

To query this endpoint, you'll first need to retrieve an access token. Information about that can be found on the Authentication API document.

Endpoint Information

  • Method: POST
  • URL: https://public-api.wordpress.com/rest/v1.3/jpphp/{$blog_id}/ftp-credentials

$blog_id is the is the WordPress.com blog id.

Request Parameters

  • ftp_user: Set FTP user.
  • ftp_pass: (optional) Set FTP password.
  • ftp_host: Set FTP host.
  • ftp_port: (optional) Set FTP port. Will default to 21 is missing.

Successful response

  • success: (bool) Was the operation successful?

Errored response

  • error_code: (string) Error code, if any.
  • error_message: (string) Error message, if any.

Example

curl --request POST \
  --url https://public-api.wordpress.com/rest/v1.3/jpphp/$BLOG_ID/ftp-credentials \
  --header 'Accept: */*' \
  --header 'Authorization: Bearer $ACCESS_TOKEN' \
  --header 'Cache-Control: no-cache' \
  --header 'Host: public-api.wordpress.com' \
  --form ftp_host=$FTP_HOST \
  --form ftp_user=$FTP_USER \
  --form ftp_pass=$FTP_PASS