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

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": "/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": "/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq/addresses"
            },
            {
                "type": "application/vnd.elasticpath.links",
                "rel": "paymentmethods",
                "rev": "profile",
                "href": "https://localhost:8443/cortex/paymentmethods/mobee",
                "uri": "/paymentmethods/mobee"
            },
            {
                "type": "application/vnd.mycompany.extensionprofile",
                "rel": "extensionprofile",
                "rev": "profile",
                "href": "https://localhost:8443/cortex/extensionprofile/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq",
                "uri": "/extensionprofile/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq"
            },        {
                "type": "application/vnd.elasticpath.links",
                "rel": "purchases",
                "href": "https://localhost:8443/cortex/purchases/mobee",
                "uri": "/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": "/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": "/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq"
            }
        ]
    }