Security Monitoring

Get AST for source code

Parse source code into an abstract syntax tree (AST) for the specified language.

post/api/v2/static-analysis/static-analysis-server/get-ast

Request

  • Base URL
    https://api.datadoghq.com
  • URL
    https://api.datadoghq.com/api/v2/static-analysis/static-analysis-server/get-ast
  • Auth
    • API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
    • or OAuth 2
      Authorization code: /oauth2/v1/authorize
      Token URL: /oauth2/v1/token scopes: code_analysis_read

Request body

Example request

{
  "data": {
    "attributes": {
      "code": "aW1wb3J0IHN5cw==",
      "file_encoding": "utf-8",
      "language": "python"
    },
    "type": "get_ast_request"
  }
}

Response

OK

Example response

{
  "data": {
    "type": "get_ast_response"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.