OK, I tried doing this with curl, using the endpoint I found in my browser network utilities after restarting PHP from the CP. My request is returning a 404, any ideas on a reason why?
(I am able to run this command from another API client with the same credentials 😞)
curl -X POST -v -H "Authorization: Bearer <<token-id>>" https://<<cp-url>>/api/v2/websites/<<website-id>>/restart_php
* Trying 5.78.114.234:443...
* Connected to <<cp-url>> (5.78.114.234) port 443
* ALPN: curl offers h2,http/1.1
* (304) (OUT), TLS handshake, Client hello (1):
* CAfile: /etc/ssl/cert.pem
* CApath: none
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-CHACHA20-POLY1305-SHA256
* ALPN: server accepted h2
* Server certificate:
* subject: CN=<<cp-url>>
* start date: Feb 13 20:00:38 2024 GMT
* expire date: May 13 20:00:37 2024 GMT
* subjectAltName: host "<<cp-url>>" matched cert's "<<cp-url>>"
* issuer: C=US; O=Let's Encrypt; CN=R3
* SSL certificate verify ok.
* using HTTP/2
* [HTTP/2] [1] OPENED stream for https://<<cp-url>>/api/v2/websites/<<website-id>>/restart_php
* [HTTP/2] [1] [:method: POST]
* [HTTP/2] [1] [:scheme: https]
* [HTTP/2] [1] [:authority: <<cp-url>>]
* [HTTP/2] [1] [:path: /api/v2/websites/<<website-id>>/restart_php]
* [HTTP/2] [1] [user-agent: curl/8.4.0]
* [HTTP/2] [1] [accept: */*]
* [HTTP/2] [1] [authorization: Bearer <<token-id>>]
> POST /api/v2/websites/<<website-id>>/restart_php HTTP/2
> Host: <<cp-url>>
> User-Agent: curl/8.4.0
> Accept: */*
> Authorization: Bearer <<token-id>>
>
< HTTP/2 400
< server: nginx/1.25.3
< date: Wed, 14 Feb 2024 23:26:49 GMT
< content-length: 0
<
* Connection #0 to host <<cp-url>> left intact