Scenario #5001: Subscribe Existing Person And Contact To Mailinglist

UseCase Subscribe Existing Person And Contact To Mailinglist => Subscription: Michael Miller to operations-discussion

Given Properties

name value
partnerPersonTradeName Test AG
subscriberFamilyName Miller
subscriberGivenName Michael
subscriberEMailAddress michael.miller@example.org
mailingList operations-discussion

Person: Test AG

GET /api/hs/office/persons?name=Test+AG
=> status: 200 OK 
[ {
  "uuid" : "f8f6ad7e-53d2-4cf0-9cb9-30ca2767c599", // Person: Test AG
  "personType" : "LEGAL_PERSON",
  "tradeName" : "Test AG",
  "salutation" : null,
  "title" : null,
  "givenName" : null,
  "familyName" : null
} ]

In production, data this query could result in multiple outputs. In that case, you have to find out which is the right one.

Person: Michael Miller

GET /api/hs/office/persons?name=Miller
=> status: 200 OK 
[ {
  "uuid" : "554e0c62-8789-4919-b7ad-5a5a422dc538",
  "personType" : "NATURAL_PERSON",
  "tradeName" : null,
  "salutation" : null,
  "title" : null,
  "givenName" : "Michael",
  "familyName" : "Miller"
} ]

In real scenarios there are most likely multiple results and you have to choose the right one.

Contact: michael.miller@example.org

GET /api/hs/office/contacts?emailAddress=michael.miller@example.org
=> status: 200 OK 
[ {
  "uuid" : "50b9a8a3-f80b-4278-9ac6-44ce90ee7e3d",
  "caption" : "Michael Miller",
  "postalAddress" : { },
  "emailAddresses" : {
    "main" : "michael.miller@example.org"
  },
  "phoneNumbers" : { }
} ]

In real scenarios there are most likely multiple results and you have to choose the right one.

Create Subscription: Michael Miller to operations-discussion

POST /api/hs/office/relations
{
  "type" : "SUBSCRIBER",
  "mark" : "operations-discussion",
  "anchor.uuid" : "f8f6ad7e-53d2-4cf0-9cb9-30ca2767c599", // Person: Test AG
  "holder.uuid" : "554e0c62-8789-4919-b7ad-5a5a422dc538", // Person: Michael Miller
  "contact.uuid" : "50b9a8a3-f80b-4278-9ac6-44ce90ee7e3d" // Contact: michael.miller@example.org
}
=> status: 201 CREATED afcf1469-61da-4588-a17f-3f8ab3c07625

generated on 03-10-2025 12:08:18 for branch master