Visitar URL original
UpdateConnector: PUT and DELETE answer success for a key that does not exist · Issue #202 · AFASSoftware/OASContent · GitHub
Skip to content

UpdateConnector: PUT and DELETE answer success for a key that does not exist #202

Open

Description

Context. We maintain the AFAS Profit (AFAS Online) driver of Invantive UniversalSQL, which customers use from
Power BI and from Claude (through the Invantive MCP server). Since this week it writes through UpdateConnectors with
SQL insert, update and delete.

  1. No error for a missing key. On Profit 8.8.11, PUT /connectors/HrCostCarrier with
    {"HrCostCarrier":{"Element":{"@CmId":"01","@CcId":"ITGNONE","Fields":{"CcDs":"x"}}}} answers 201, and
    DELETE /connectors/HrCostCarrier/HrCostCarrier/@CmId,@CcId/01,ITGNONE answers 200, while no cost carrier
    ITGNONE exists and nothing changes. A client cannot tell a successful change from a typo in the key. Is this
    intended? If so, could the documentation say so, or could the response state the number of records changed?
  2. A key of more than one field in a DELETE. update-connector.md shows a DELETE with one key
    (/connectors/KnSubject/KnSubject/@SbId/2). For HrCostCentre, whose key is CmId and CrId,
    /connectors/HrCostCentre/HrCostCentre/@CmId,@CrId/01,ITGTEST1 works (200). Could the documentation show this
    form, and say how a value containing a comma is passed?

Activity

  1. guidol-ive commented on Nov 7, 2026

    @guidol-ive
    Author

    Reproduction of point 1: success for a key that does not exist.

    Measured on 2026-11-07 against a Profit 8.8.11 test environment. No cost carrier ITGNONE exists for employer 01.

    AFAS_URL='https://12345.resttest.afas.online/ProfitRestServices'
    AFAS_TOKEN="AfasToken $(printf '<token><version>1</version><data>%s</data></token>' "$TOKEN" | base64)"

    Change the description of the cost carrier that does not exist:

    curl -i -X PUT "$AFAS_URL/connectors/HrCostCarrier" \
      -H "Authorization: $AFAS_TOKEN" \
      -H 'Content-Type: application/json' \
      --data '{
      "HrCostCarrier": {
        "Element": {
          "@CmId": "01",
          "@CcId": "ITGNONE",
          "Fields": {
            "CcDs": "x"
          }
        }
      }
    }'

    Answer: HTTP/1.1 201 Created, with an empty body.

    Delete the same cost carrier:

    curl -i -X DELETE "$AFAS_URL/connectors/HrCostCarrier/HrCostCarrier/@CmId,@CcId/01,ITGNONE" \
      -H "Authorization: $AFAS_TOKEN"

    Answer: HTTP/1.1 200 OK.

    In both cases, nothing changes in Profit and no cost carrier ITGNONE is created. We expected an error, such as 404 or 400, or a response that says no record was changed.

  2. guidol-ive commented on Nov 7, 2026

    @guidol-ive
    Author

    Reproduction of point 2: DELETE with a key of more than one field.

    Measured on 2026-11-07 against a Profit 8.8.11 test environment. HrCostCentre has the key fields CmId (employer) and CrId (cost centre). AFAS_URL and AFAS_TOKEN are set as in the previous comment.

    Create a cost centre:

    curl -i -X POST "$AFAS_URL/connectors/HrCostCentre" \
      -H "Authorization: $AFAS_TOKEN" \
      -H 'Content-Type: application/json' \
      --data '{
      "HrCostCentre": {
        "Element": {
          "@CmId": "01",
          "@CrId": "ITGTEST1",
          "Fields": {
            "CrDs": "Test cost centre",
            "Bl": false
          }
        }
      }
    }'

    Delete it, with both key fields and both values separated by a comma:

    curl -i -X DELETE "$AFAS_URL/connectors/HrCostCentre/HrCostCentre/@CmId,@CrId/01,ITGTEST1" \
      -H "Authorization: $AFAS_TOKEN"

    Answer: HTTP/1.1 200 OK, and the cost centre is gone from Profit.

    update-connector.md only shows the form with one key field. Questions:

    • Is this comma-separated form the supported way to delete with a key of more than one field?
    • How is a key value that contains a comma passed, such as a cost centre A,B? URL encoding it as A%2CB is a natural guess, but the documentation does not say how the server splits the values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions