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.
To query this endpoint, you'll first need to retrieve an access token. Information about that can be found on the Authentication API document.
- 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.
- 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.
- success: (bool) Was the operation successful?
- error_code: (string) Error code, if any.
- error_message: (string) Error message, if any.
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