icloud-photos-sync local server API 1.0
This document describes the API of icloud-photo-sync's web server
Servers
| Description | URL |
|---|---|
| The URL and port depend on your local setup - by default the webserver is exposed at port 80 | http://localhost:80 |
Endpoints
GET /api/state
Provides the current operational state of the application's
Response 200 OK
{
"state": "ready",
"timestamp": 10.12,
"nextSync": 10.12,
"prevError": {
"message": "string",
"code": "string"
},
"prevTrigger": "sync",
"progressMsg": "string",
"progress": 10.12
}
Schema of the response body
{
"type": "object",
"required": [
"state",
"timestamp"
],
"properties": {
"state": {
"type": "string",
"enum": [
"ready",
"running",
"blocked"
]
},
"timestamp": {
"type": "number"
},
"nextSync": {
"type": "number"
},
"prevError": {
"type": "object",
"properties": {
"message": {
"type": "string"
},
"code": {
"type": "string"
}
}
},
"prevTrigger": {
"type": "string",
"enum": [
"sync",
"auth"
]
},
"progressMsg": {
"type": "string"
},
"progress": {
"type": "number"
}
}
}
GET /api/log
Provides all stored log entries since the last trigger
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
loglevel |
query | string | No | The selected log level to be returned by the response, defaults to 'none' |
Response 200 OK
[
{
"level": "debug",
"time": 10.12,
"source": "string",
"message": "string"
}
]
Schema of the response body
{
"type": "array",
"items": {
"type": "object",
"properties": {
"level": {
"type": "string",
"enum": [
"debug",
"info",
"warn",
"error"
]
},
"time": {
"type": "number"
},
"source": {
"type": "string"
},
"message": {
"type": "string"
}
}
}
}
POST /api/reauthenticate
Requests the application to re-authenticate
Response 200 OK
Schema of the response body
POST /api/sync
Requests the application to execute an ad-hoc sync
Response 200 OK
Schema of the response body
POST /api/resend_mfa
Requests the tool to resend the MFA code utilizing the provided method
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
method |
query | string | No | The selected resend method | |
phoneNumberId |
query | integer | No | Optionally defining a phone number id (in case multiple trusted phone numbers are registered with the account) |
Response 200 OK
Schema of the response body
Response 400 Bad Request
Schema of the response body
POST /api/mfa
Enters the MFA code for authentication
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
code |
query | integer | No | The MFA code provided by the trusted source |
Response 200 OK
Schema of the response body
Response 400 Bad Request
Schema of the response body
Response 412 Precondition Failed
Schema of the response body
POST /api/subscribe
Creates a notification subscription
Request body
{
"endpoint": "string",
"keys": {
"p256dh": "string",
"auth": "string"
}
}
Schema of the request body
{
"type": "object",
"properties": {
"endpoint": {
"type": "string"
},
"keys": {
"type": "object",
"properties": {
"p256dh": {
"type": "string"
},
"auth": {
"type": "string"
}
}
}
}
}
Response 200 OK
Schema of the response body
Response 400 Bad Request
Schema of the response body
GET /api/vapid-public-key
Gets the VAPID public key, required for push notification support
Response 200 OK
{
"publicKey": "string"
}
Schema of the response body
{
"type": "object",
"properties": {
"publicKey": {
"type": "string"
}
}
}