Skip to main content
PUT
/
parsers
/
{id}
Update a parser
import requests

url = "https://{FUSION HOST}/api/parsers/{id}"

payload = {
    "detectMediaTypeBasedOnExtension": True,
    "enableMediaTypeDetection": True,
    "id": "<string>",
    "idField": "<string>",
    "maxFieldLength": 123,
    "maxParserDepth": 123,
    "parserStages": [
        {
            "enabled": True,
            "errorHandling": "fail",
            "id": "<string>",
            "ignoredMediaTypes": ["<string>"],
            "inheritMediaTypes": True,
            "label": "<string>",
            "mediaTypes": ["<string>"],
            "outputFieldPrefix": "<string>",
            "pathPatterns": [
                {
                    "pattern": "<string>",
                    "syntax": "glob"
                }
            ]
        }
    ]
}
headers = {
    "Authorization": "Basic <encoded-value>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
{
  "detectMediaTypeBasedOnExtension": true,
  "enableMediaTypeDetection": true,
  "id": "<string>",
  "idField": "<string>",
  "maxFieldLength": 123,
  "maxParserDepth": 123,
  "parserStages": [
    {
      "enabled": true,
      "errorHandling": "fail",
      "id": "<string>",
      "ignoredMediaTypes": [
        "<string>"
      ],
      "inheritMediaTypes": true,
      "label": "<string>",
      "mediaTypes": [
        "<string>"
      ],
      "outputFieldPrefix": "<string>",
      "pathPatterns": [
        {
          "pattern": "<string>",
          "syntax": "glob"
        }
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Path Parameters

id
string
required

The entity ID

Query Parameters

context
string

The app to which this object belongs, as app:SomeApp. If the app doesn't exist, the request fails. Other comma-separated contexts in the context parameter are allowed but ignored.

Body

application/json
detectMediaTypeBasedOnExtension
boolean
enableMediaTypeDetection
boolean
id
string
idField
string
maxFieldLength
integer
maxParserDepth
integer
parserStages
ParserStageConfigReq · object[]

Response

OK

detectMediaTypeBasedOnExtension
boolean
enableMediaTypeDetection
boolean
id
string
idField
string
maxFieldLength
integer
maxParserDepth
integer
parserStages
ParserStageConfigRes · object[]