CoreAPI CO Person Write API Create does not return Identifier

XMLWordPrintable

      Consider a Core API Person Write API instantiated and configured to use an Extended Type Identifier as the Identifier used for keying the CO Person records. Further, an Identifier Assignment is configured to automatically generate an Identifier of that Extended Type.

      When the Create API Endpoint is invoked (POST) and a value for the Identifier of the Extended Type is NOT included (because it is going to be automatically generated by the Identifier Assignment), the POST return code is a 201, but instead of returning a list of the new Identifier(s) for the new CO Person record(s), an empty JSON list is returned.

      As a concrete example, I am sending in this JSON

      {
        "CoPerson": {
          "co_id": 2,
          "status": "A",
          "timezone": null,
          "date_of_birth": null
        },
        "EmailAddress": [
          {
            "mail": "skoranda@illinois.edu",
            "type": "official",
            "verified": true,
            "description": null
          }
        ],
        "CoPersonRole": [
          {
            "cou_id": null,
            "affiliation": "member",
            "title": null,
            "o": null,
            "ou": null,
            "valid_from": null,
            "valid_through": null,
            "status": "A",
            "ordr": null,
            "manager_co_person_id": null,
            "Address": [],
            "AdHocAttribute": [],
            "TelephoneNumber": []
          }
        ],
        "Name": [
          {
            "honorific": "",
            "given": "Scott",
            "middle": "",
            "family": "Koranda",
            "suffix": "",
            "type": "official",
            "language": "",
            "primary_name": true
          }
        ],
        "Url": [],
        "Password": [],
        "SshKey": [],
        "UnixClusterAccount": []
      }

      using this curl command

      curl \
          --verbose \
          -u 'co_2.rest_user_01:iXXXXXXXX' \
          -X POST \
          -d @/tmp/scott_koranda.json \
          -H 'Content-Type:application/json' \
          'https://registry-dev.cilogon.org/registry/api/co/2/core/v1/people'

      I see

      < HTTP/2 201 
      < date: Mon, 29 Jul 2024 17:44:29 GMT
      < content-type: application/json; charset=UTF-8
      < content-length: 2
      < server: Apache/2.4.59 (Debian)
      < x-powered-by: PHP/8.1.29
      < set-cookie: CAKEPHP=tdpq1oivfte60pbugum32fstgn; expires=Tue, 30-Jul-2024 01:44:28 GMT; Max-Age=28800; path=/; secure; HttpOnly
      < content-security-policy: frame-ancestors 'self';
      * TLSv1.2 (IN), TLS header, Supplemental data (23):
      * Connection #0 to host registry-dev.cilogon.org left intact
      [] 

      The CO Person record is created and has the Identifier of the Extended Type that was automatically generated by the Identifier Assignment, but that new Identifier value was not included in the return body.

      The documentation at https://spaces.at.internet2.edu/display/COmanage/Core+API#CoreAPI-CreateAPIEndpoint says "The Create request will include the newly assigned Identifier of the configured type in the response body."

       

            Assignee:
            Scott Koranda
            Reporter:
            Scott Koranda
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: