Demoing the Core Lookup Resource
Demoing the Core Lookup Resource
Make a request to the new Email resource using a REST client to get an email address
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 the profile resource:
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 }, "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.mycompany.email","rel": "email","rev": "profile","href": "https://localhost:8443/cortex/email/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq","uri": "/commerce-legacy/email/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq" }, { "type": "application/vnd.elasticpath.links", "rel": "paymentmethods", "rev": "profile", "href": "https://localhost:8443/cortex/paymentmethods/mobee", "uri": "/commerce-legacy/paymentmethods/mobee" }, { "type": "application/vnd.elasticpath.links", "rel": "purchases", "href": "https://localhost:8443/cortex/purchases/mobee", "uri": "/commerce-legacy/purchases/mobee" } ], "family-name": "Harris", "given-name": "Oliver" }
- Make a GET request to the Email resource using the link provided by the response above (https://localhost:8443/dcapi/email/profiles/mobee/gy3ukmrygbaugljxiu4dml...). The request to the Email resource should return the following:
{ "self": { "type": "application/vnd.mycompany.email", "href": "https://localhost:8443/cortex/email/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq", "uri": "/commerce-legacy/email/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq", "max-age": 0 }, "email": "oliver.harris@elasticpath.com""links": [ { "type": "application/vnd.elasticpath.profile", "rel": "profile", "rev": "email", "href": "https://localhost:8443/cortex/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq", "uri": "/commerce-legacy/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq" } ] }