---
agentTools:
  projectIndex: https://devapi-edrv.readme.io/llms.txt
---

# /v1.1/chargestations/{id}/get_diagnostics

Request chargestation to upload local logs to an FTP server. Works for both OCPP 1.6 (GetDiagnostics) and OCPP 2.0.1 (GetLog) charge stations. For OCPP 2.0.1, `location` maps to the GetLog `log.remoteLocation`, `startTime`/`stopTime` map to `oldestTimestamp`/`latestTimestamp`, and `logType`/`requestId`/`retries`/`retryInterval` are supported (`requestId` is auto-generated when omitted).

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "eDRV API",
    "version": "v1.1",
    "description": "edrv.io API Documentation",
    "contact": {
      "name": "eDRV",
      "url": "https://edrv.io",
      "email": "support@edrv.io"
    }
  },
  "security": [
    {
      "oauth2": []
    }
  ],
  "paths": {
    "/v1.1/chargestations/{id}/get_diagnostics": {
      "post": {
        "description": "Request chargestation to upload local logs to an FTP server. Works for both OCPP 1.6 (GetDiagnostics) and OCPP 2.0.1 (GetLog) charge stations. For OCPP 2.0.1, `location` maps to the GetLog `log.remoteLocation`, `startTime`/`stopTime` map to `oldestTimestamp`/`latestTimestamp`, and `logType`/`requestId`/`retries`/`retryInterval` are supported (`requestId` is auto-generated when omitted).",
        "tags": [
          "Advance Chargestations"
        ],
        "operationId": "get_diagnostics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "The charge station id that needs to be fetched",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "location": {
                    "type": "string",
                    "description": "FTP server Upload Credentials",
                    "example": "ftp://username:password@FTP-server.com/"
                  },
                  "startTime": {
                    "type": "string",
                    "description": "Logs Start datetime in ISOString Format. For OCPP 2.0.1 maps to `log.oldestTimestamp`.",
                    "example": "2021-01-13T16:19:50.340Z"
                  },
                  "stopTime": {
                    "type": "string",
                    "description": "Logs Stop datetime in ISOString Format. For OCPP 2.0.1 maps to `log.latestTimestamp`.",
                    "example": "2021-07-13T16:19:50.340Z"
                  },
                  "retries": {
                    "type": "integer",
                    "description": "Optional. Number of times the charge station retries the upload before giving up.",
                    "example": 3
                  },
                  "retryInterval": {
                    "type": "integer",
                    "description": "Optional. Interval (in seconds) between upload retries.",
                    "example": 60
                  },
                  "logType": {
                    "type": "string",
                    "description": "OCPP 2.0.1 only. Type of log to retrieve. Defaults to `DiagnosticsLog`.",
                    "enum": [
                      "DiagnosticsLog",
                      "SecurityLog"
                    ],
                    "example": "DiagnosticsLog"
                  },
                  "requestId": {
                    "type": "integer",
                    "description": "OCPP 2.0.1 only. Correlation id for the log upload. Auto-generated when omitted.",
                    "example": 1
                  },
                  "meta_data": {
                    "$ref": "#/components/schemas/schema1"
                  }
                },
                "required": [
                  "location"
                ]
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Returns a command object with log file name being uploaded via FTP. Caller should save `command.response_data` returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "message": {
                      "type": "string"
                    },
                    "result": {
                      "type": "object",
                      "properties": {
                        "command": {
                          "type": "object",
                          "properties": {
                            "_id": {
                              "type": "string",
                              "description": "Command Id",
                              "example": "6a2d55ca5dc09e093c4be720"
                            },
                            "type": {
                              "type": "string",
                              "description": "Internal command name. `GetDiagnostics` for OCPP 1.6, `GetLog` for OCPP 2.0.1.",
                              "example": "GetLog"
                            },
                            "status": {
                              "type": "string",
                              "description": "State of the command. `CSAccepted`/`CSRejected` lets the caller know if the chargestation accepted the command.",
                              "example": "CSAccepted",
                              "enum": [
                                "APIRequested",
                                "CSMSProcessing",
                                "CSAccepted",
                                "CSRejected",
                                "Error"
                              ]
                            },
                            "chargestation": {
                              "type": "string",
                              "description": "ID of the parent chargestation. See `chargestations` api.",
                              "example": "618ea8f5549b8266acbac92a"
                            },
                            "connector": {
                              "type": "string",
                              "description": "ID of the connector, when applicable.",
                              "example": "5fca57b3fbfcc320b3b03f22"
                            },
                            "data": {
                              "type": "object",
                              "description": "Raw command parameters sent to the charge station. Shape differs by protocol (GetDiagnostics vs GetLog).",
                              "example": {
                                "logType": "DiagnosticsLog",
                                "requestId": 362132768,
                                "log": {
                                  "remoteLocation": "ftp://username:password@ftp-server.com/"
                                }
                              }
                            },
                            "response_data": {
                              "type": "object",
                              "description": "Raw command response from the charge station. Contains the uploaded log filename.",
                              "example": {
                                "status": "Accepted",
                                "filename": "AXYM221003D1P1-C2320A004A0-20260613130617.zip"
                              }
                            },
                            "meta_data": {
                              "$ref": "#/components/schemas/schema1"
                            },
                            "createdAt": {
                              "$ref": "#/components/schemas/schema2"
                            },
                            "updatedAt": {
                              "$ref": "#/components/schemas/schema2"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A failure response"
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "//devapi.edrv.io"
    }
  ],
  "components": {
    "securitySchemes": {
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "implicit": {
            "authorizationUrl": "https://auth.edrv.io/authorize",
            "scopes": {}
          }
        }
      }
    },
    "schemas": {
      "schema1": {
        "type": "object",
        "description": "Any custom data, the developer wants to attach.",
        "example": {
          "sample_key1": "some text",
          "sample_key2": 1234.56
        }
      },
      "schema2": {
        "type": "string",
        "format": "date-time",
        "description": "UTC Date as an ISO String",
        "example": "2021-07-21T12:50:36.660Z",
        "readOnly": true
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 98,
      "1": 1,
      "2": 21,
      "3": 115,
      "4": 54,
      "5": 236,
      "6": 182,
      "7": 105,
      "8": 121,
      "9": 147,
      "10": 78,
      "11": 167
    }
  }
}
```