Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

This Example Project demonstrates how to consume this API endpoint within a C# project.

URI: https://app.cloudcardtools.com/api/people/{id}

HTTP Method: PUT

Required Headers: X-Auth-Token (see: Authentication)

Optional URL Parameters: 

  • allowCreate=[true|false] default is false 
    • If true a new person will be created if a person is not found for the specified URI.  
    • If false an error, 404 Not Found, is returned if a person is not found for the specified URI.
  • getLoginLink=[true|false] default is false
    • If false, just the person is returned as the root element of the JSON object

    • If true, the person is return alongside his login link as the user and access_link elements of the JSON response object.  A person's login link contains a unique, secure token that allows them to log into the CloudCard without entering their username or password.

Example HTTP Request Body - All fields are optional
{
  "email": "jon.doe@foo.edu",
  "identifier":"ABC123",
  "Some Custom Field":"Some Custom Field Value",
  "Another Custom Field":"Another Custom Field Value"
}
Example HTTP Response
201 created

{
    "accountExpired": false,
    "accountLocked": false,
    "activatedDate": null,
    "authorities": [
        {
            "class": "com.campuscardtools.myphotoid.Role",
            "id": 3,
            "authority": "ROLE_CARDHOLDER"
        }
    ],
    "currentPhoto": {
        "aspectRatio": 0.9915966387,
        "classifications": [],
        "domainClass": "com.campuscardtools.myphotoid.Photo",
        "id": 11982,
        "isAspectRatioCorrect": true,
        "links": {
            "bytes": "https://test.cloudcardtools.com/api/photos/jflsdkjflf/bytes"
        },
        "lowestClassification": null,
        "originalPhoto": null,
        "person": {...},
        "publicKey": "jflsdkjflf",
        "status": "DONE"
    },
    "customFields": {
        "Name": {
            "class": "com.campuscardtools.myphotoid.CustomFieldValue",
            "id": 11790,
            "customField": {...},
            "lastUpdated": "2018-01-12T18:21:27Z",
            "person": {...},
            "value": "Abe Lincoln"
        }
    },
    "dateTermsAccepted": null,
    "domainClass": "com.campuscardtools.myphotoid.Person",
    "email": "bacon@test.edu",
    "emailsReceived": 2,
    "enabled": true,
    "id": 19674,
    "identifier": "bacon",
    "latestPhoto": null,
    "organization": {
        "id": 38,
        "domainClass": "com.campuscardtools.myphotoid.Organization",
        "name": "Test Univ",
        "isPaid": true,
        "termsOfService": "Lorem ipsum dolor sit amet, ...",
        "photoRequirements": [],
        "customFields": [
            {
                "name": "Name"
            }
        ],
        "customCssUrl": null,
        "useEmailAsUsername": true,
        "usePersonIdentifier": true,
        "personIdentifierLabel": "ID Number",
        "downloadStrategy": {...},
        "aspectRatio": {...},
        "preventMultiplePhotos": false,
        "approvalsPerDay": null,
        "approvalsMadeToday": 0,
        "canApproveMorePhotosToday": true,
        "allowAutoCrop": false,
        "allowAutoRotate": false
    },
    "passwordExpired": false,
    "passwordResetRequired": false,
    "readOnly": false,
    "username": "bacon@test.edu"
}

Example: Update User to Get Login Link as a Cardholder

This request will revoke office user and director roles if the user posses them.

PUT https://app.cloudcardtools.com/api/people/bacon@test.edu?getLoginLink=true
{} //the request body should be empty
Example HTTP Response (w/ Login Link)
200 OK
{
    "user": {
        "class": "com.campuscardtools.myphotoid.Person",
        "id": 19674,
        "accountExpired": false,
        "accountLocked": false,
        "activatedDate": null,
        "additionalPhotos": [],
        "customFieldValues": [
            {
                "class": "com.campuscardtools.myphotoid.CustomFieldValue",
                "id": 11790
            }
        ],
        "dateTermsAccepted": null,
        "email": "bacon@test.edu",
        "enabled": true,
        "identifier": "bacon",
        "lastUpdated": "2018-01-16T20:47:44Z",
        "organization": {
            "class": "com.campuscardtools.myphotoid.Organization",
            "id": 38
        },
        "password": "29cDb7jiPtjXG0vEgiRl3Shn",
        "passwordExpired": false,
        "passwordResetRequired": false,
        "photos": [
            {
                "class": "com.campuscardtools.myphotoid.Photo",
                "id": 11982
            }
        ],
        "roles": [...],
        "username": "bacon@test.edu"
    },
    "access_link": "https://test.cloudcardtools.com/#/login?access_token=kjflskdjhfkajfewlkrjflsfkndlaf"
}

Example: Update User to Get Login Link as an Office User

This request will grant the office user role if the user did not already posses it.


PUT https://app.cloudcardtools.com/api/people/bacon@test.edu?getLoginLink=true
{ "ROLE_OFFICE": true }
Example HTTP Response (w/ Login Link)
200 OK
{
    "user": {
        "class": "com.campuscardtools.myphotoid.Person",
        "id": 19674,
        "accountExpired": false,
        "accountLocked": false,
        "activatedDate": null,
        "additionalPhotos": [],
        "customFieldValues": [...],
        "dateTermsAccepted": null,
        "email": "bacon@test.edu",
        "enabled": true,
        "identifier": "bacon",
        "lastUpdated": "2018-01-16T20:47:44Z",
        "organization": {...},
        "password": "29cDb7jiPtjXG0vEgiRl3Shn",
        "passwordExpired": false,
        "passwordResetRequired": false,
        "photos": [...],
        "roles": [...],
        "username": "bacon@test.edu"
    },
    "access_link": "https://test.cloudcardtools.com/#/login?access_token=kjflskdjhfkajfewlkrjflsfkndlaf"
}

  • No labels