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.
- 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.
- Enter the following fields in your REST client to make a GET request to Oliver Harris' profile:
The response you get back should have the following content:
Table 1. HTTP Request Parameters HTTP Request Method GET URL https://localhost:8443/cortex/profiles/mobee/default Header Content-type: Application/json { "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" } ] }
- 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" } ] }