Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Demoing the Extended Profiles Resource

Demoing the Extended Profiles Resource

Make a request to the resource extension using a REST client and get an ExtendedProfile back.
  1. Using a REST client, log into the demo store by following the instructions here: http://api-cortex-developers.docs.elasticpath.com/drupal/content/Authenticate_a_customer using Username: oliver.harris@elasticpath.com and password: password.
  2. Enter the following fields in your REST client to make a GET request to Oliver Harris' profile:
    Table 1.
    HTTP Request Parameters
    HTTP Request Method GET
    URL https://localhost:8443/cortex/profiles/mobee/default
    Header Content-type: Application/json
    The response you get back should have the following content:
    {
        "self": {
            "type": "application/vnd.elasticpath.profile",
            "href": "https://localhost:8443/cortex/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq",
            "uri": "/commerce-legacy/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq",
        	"max-age": 0
        },
    	"family-name": "Harris",
    	"given-name": "Oliver",	
    	"links": [
            {
                "type": "application/vnd.elasticpath.links",
                "rel": "addresses",
                "rev": "profile",
                "href": "https://localhost:8443/cortex/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq/addresses",
                "uri": "/commerce-legacy/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq/addresses"
            },
            {
                "type": "application/vnd.elasticpath.links",
                "rel": "paymentmethods",
                "rev": "profile",
                "href": "https://localhost:8443/cortex/paymentmethods/mobee",
                "uri": "/commerce-legacy/paymentmethods/mobee"
            },
            {
                "type": "application/vnd.mycompany.extensionprofile",
                "rel": "extensionprofile",
                "rev": "profile",
                "href": "https://localhost:8443/cortex/extensionprofile/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq",
                "uri": "/commerce-legacy/extensionprofile/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq"
            },        {
                "type": "application/vnd.elasticpath.links",
                "rel": "purchases",
                "href": "https://localhost:8443/cortex/purchases/mobee",
                "uri": "/commerce-legacy/purchases/mobee"
        	}
        ]
    }
    
  3. Make a GET request to the ExtensionProfile resource using the link provided by the response above (https://localhost:8443/cortex/extensionprofile/profiles/mobee/gy3ukmrygb...).
    The request to the ExtensionProfile resource should return the following:
    {
        "self": {
             "type": "application/vnd.mycompany.extensionprofile",
             "href": "https://localhost:8443/cortex/extensionprofile/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq",
             "uri": "/commerce-legacy/extensionprofile/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq","max-age": 0,
        },
        "familyName": "Harris",
        "name": "Oliver",
        "profileId": "gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq",
        "links": [
            {
                "type": "application/vnd.elasticpath.profile",
                "rel": "profile",
                "rev": "extensionprofile",
                "href": "https://localhost:8443/cortex/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq,
                "uri": "/commerce-legacy/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq"
            }
        ]
    }