Skip to content

Getting Accounts

Unmanagable Accounts

Within MyPup the accounts are "shared" accross all the tenants. This means that the e-mail addresses are globally unique. Only accounts that are linked to a PickUpPoint that you (the tenant) can manage can be managed (looked up and/or changed). All other accounts cannot be looked up. It is however possible to check if an e-mail address is already registered with MyPup by using the GetAccount call.

Respect Account Privacy

Using these API-calls you gain access to personal information. Please use these calls wisely with respect to the GDPR.

GetAccount

Location /v1/Account/GetAccount

Can be used to check if an account exists or to get full account's details. You can search for an account using the username or the e-mail address. When multiple fields are specified, accounts are searched in the following order: userUid, username, emailAddress. If no fields are specified or no accounts could not be found the result message's userUid field is null.

When the account exists but you cannot manage the account (isExisting is true and canManageUser is false) the result will contain the userUid of the existing user.

{
    # Mandatory Fields
    "userName": null,               # Search the user by its username
    "emailAddress": null,           # Search the user by its email address
    "userUid": null                 # Search the user by its uid
}
POST /v1/Account/GetAccount HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
  "emailAddress": "janjanssen@domain.com",
  "userName": null,
  "userUid": null
}
{
  "isExisting": true/false,         # True when the account exists and was found.
  "userName": "JJansen",            # Username (if found)
  "userUid": "638f2f...a2fa",       # Unique identifier (if found)
  "canManageUser": true/false,      # True when the authenticated user (you) can manage/change/see the 
                                    # user's details. If the user/account is managed by another
                                    # tenant then this will be false and all the other fields are null.
  "userName": "janjansen80",
  "firstName": "Jan",
  "lastName": "Janssen",
  "emailAddress": null,
  "phoneNumber": null,
  "mainPupUid": "6d35...2f63",      # Linked main pick up point for this account.
  "mainPupName": "Pup Name",
  "mailCode": "MyPup A...F",        # Mail delivery code of this account
  "languageCode": "en-GB",          # Optional language code of the account.
  "street": null,
  "mailbox": null,
  "city": null,
  "countryCode": null,

  "success": true/false,            # Command executed successfully
  "error": null,                    # Error code (if any)
  "message": null                   # Error message (if any)
}
error code Description
Generic Error Codes Any of the generic error codes.

GetAccounts

Location /v1/Account/GetAccounts

Can be used to search for accounts (that can be managed).

{
    # Mandatory Fields
    "userName": null,                   # Search the user by its username. You can use the 
    "emailAddress": null,               # Search the user by its email address

    "fullName": null,                   # Search the user by full name
    "pupUid": null,                     # Search users by pick up point uid
    "phoneNumber": null,                # Search the user by its phone number
    "mailCode": null,                   # Search the user by mail code

    # Optional Fields
    "includeEmail": null/true/false,    # True when to include email in the result. 
                                        # Default: true
    "includeFullName": null/true/false, # True when to include first and last name in the result. 
                                        # Default: true
    "includeMainPup": null/true/false,  # True when to include default main PUP in the result. 
                                        # Default: true
    "includeAddress": null/true/false,  # True when to include address in the result. 
                                        # Default: false
    "includeLanguage": null/true/false, # True when to include language in the result. 
                                        # Default: false
    "includeMailCode": null/true/false, # True when to include delivery mail code in the result. 
                                        # Default: false
    "includePhone": null/true/false,    # True when to include phone number in the result. 
                                        # Default: false

    "pageNo": 1,                        # Page number, starting from 1
    "pageSize": 10,                     # Number of items on a single page. Min: 1, Max: 500
}
POST /v1/Account/GetAccounts HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
  "emailAddress": "janjanssen@domain.com",
  "userName": null,
  "fullName": null,     
  "pupUid": null,       
  "phoneNumber": null,
  "mailCode": null,
  "includeAddress": true
}
{
    "items": [
        {
            "canManage": true/false,
            "userName": "janjansen80",
            "firstName": "Jan",
            "lastName": "Janssen",
            "emailAddress": null,
            "phoneNumber": null,
            "mainPupUid": "6d35...2f63",    # Linked main pick up point for this account.
            "mainPupName": "Pup Name",
            "languageCode": "en-GB",        # Optional language code of the account.
            "mailCode": "MyPup A...F",      # Mail delivery code of this account
            "street": null,                 # Because includeAddress = true in the request
            "mailbox": null,                # Because includeAddress = true in the request
            "city": null,                   # Because includeAddress = true in the request
            "countryCode": "NL",            # Because includeAddress = true in the request
        }
    ],
    "pageNo": 1,                    # Current page number
    "pageSize": 1,                  # Amount of items per page
    "totalItems": 1,                # Total amount of items
    "totalPages": 1,                # Total amount of pages
    "success": true/false,          # Command executed successfully
    "error": null,                  # Error code (if any)
    "message": null                 # Error message (if any)
}
error code Description
Generic Error Codes Any of the generic error codes.

GetAccountPickUpPoint

Location /v1/Account/GetAccountPickUpPoint

Gets the main pick up point that is linked to an account

{
    # Mandatory Fields
    "userUid": null                 # Search the user by its uid
}
POST /v1/Account/GetAccountPickUpPoint HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
    "userUid": "638f2f...a2fa"
}
{
    "userUid": "6bac2b9....c436966b4a",
    "mailCode": "MYPUP ABCDEF GHIJKL",          # Full MailCode specific for this user
    "mailCodeFirstName": "MYPUP ABCDEF",        # Part of the MailCode used as 'first name'
    "mailCodeLastName": "GHIJKL",               # Part of the MailCode used as 'last name'
    "pupUid": "f3c75e3c......96996714c3",
    "name": "Pick Up Point A",
    "timeZone": "Europe/Amsterdam",
    "deliveryAddress": {
        "streetName": "Kuiperbergweg 32",
        "mailbox": "1101 AG",
        "city": "Amsterdam",
        "countryIso2": "NL",
        "latitude": 52.0,
        "longitude": 4.9
    },
    "locationAddress": {
        "streetName": "Kuiperbergweg 32",
        "mailbox": "1101 AG",
        "city": "Amsterdam",
        "countryIso2": "NL",
        "latitude": 52.0,
        "longitude": 4.9
    },
    "success": true,
    "error": null,
    "message": null
}
error code Description
Generic Error Codes Any of the generic error codes.

CheckAccountDeliveryDetails

Location /v1/Account/CheckAccountDeliveryDetails

Resolves a recipient's delivery details from at least two of the e-mail address, mail code and delivery address. When these uniquely match a single account, the complete delivery details are returned. For example, an e-mail address combined with the delivery address resolves the account's mail code. The mail code can be specified either as the full mailCode or split into mailCodeFirstName and mailCodeLastName.

{
    # Specify at least two of the following three: the e-mail address, the mail code
    # and the delivery address (street, mailbox, city and countryCode).
    "emailAddress": null,           # The recipient's e-mail address
    "mailCode": null,               # The recipient's full mail (delivery) code
    "mailCodeFirstName": null,      # Part of the mail code used as 'first name'
    "mailCodeLastName": null,       # Part of the mail code used as 'last name'
    "street": null,                 # Delivery street, including house number
    "mailbox": null,                # Delivery postal code
    "city": null,                   # Delivery city
    "countryCode": null             # Delivery ISO 3166-1 alpha-2 country code
}
POST /v1/Account/CheckAccountDeliveryDetails HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
  "emailAddress": "janjanssen@domain.com",
  "street": "Kuiperbergweg 32",
  "mailbox": "1101 AG",
  "city": "Amsterdam",
  "countryCode": "NL"
}
{
  "userUid": "638f2f...a2fa",           # Unique identifier of the matched account
  "pupUid": "6d35...2f63",              # Pick up point linked to the matched account
  "emailAddress": "janjanssen@domain.com",  # The matched account's e-mail address
  "mailCode": "MYPUP ABCDEF GHIJKL",        # Full mail code of the matched account
  "mailCodeFirstName": "MYPUP ABCDEF",      # Part of the mail code used as 'first name'
  "mailCodeLastName": "GHIJKL",             # Part of the mail code used as 'last name'
  "street": "Kuiperbergweg 32",             # Delivery street, including house number
  "mailbox": "1101 AG",                     # Delivery postal code
  "city": "Amsterdam",                      # Delivery city
  "countryCode": "NL",                      # Delivery ISO 3166-1 alpha-2 country code

  "success": true/false,                    # Command executed successfully
  "error": null,                            # Error code (if any)
  "message": null                           # Error message (if any)
}
error code Description
Generic Error Codes Any of the generic error codes.
InsufficientInput Fewer than two of the e-mail address, mail code and delivery address were specified.
NotFound No single account matches the specified delivery details.

GetAccountMutationConfig

Location /v1/Account/GetAccountMutationConfig

Can be used to configure which fields can be modified by the account itself and other non-administrator users.

{
    # Mandatory Fields
    "userUid": null                 # Search the user by its uid
}
POST /v1/Account/GetAccountMutationConfig HTTP/1.1
Host: api.staging.mypup.app
Authorization: Bearer ......
Content-Type: application/json

{
    "userUid": "638f2f...a2fa"
}
{
  "userUid": "638f2f...a2fa",           # Unique identifier (if found)
  "canChangeFirstName": true/false      
  "canChangeLastName": true/false
  "canChangeEmailAddress": true/false
  "canChangePhoneNumber": true/false
  "canChangeLanguageCode": true/false
  "canChangeMainPickUpPoint": true/false
  "canChangeAddress": true/false
  "canRemoveAutomatically": true/false  # Account will never be removed automatically by 
                                        # The automatic cleanup process
  "canRemoveManually": true/false       # Account cannot be removed by the account itself or
                                        # by other non-administrator users.
  .  
  "success": true/false,                # Command executed successfully
  "error": null,                        # Error code (if any)
  "message": null                       # Error message (if any)
}
error code Description
Generic Error Codes Any of the generic error codes.