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 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.
  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 the profile resource:
    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
        },
        "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.mycompany.email","rel": "email","rev": "profile","href": "https://localhost:8443/cortex/email/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq","uri": "/email/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq"
            },        {
                "type": "application/vnd.elasticpath.links",
                "rel": "paymentmethods",
                "rev": "profile",
                "href": "https://localhost:8443/cortex/paymentmethods/mobee",
                "uri": "/paymentmethods/mobee"
            },
            {
          	"type": "application/vnd.elasticpath.links",
          	"rel": "purchases",
          	"href": "https://localhost:8443/cortex/purchases/mobee",
          	"uri": "/purchases/mobee"
        	}
        ],
        "family-name": "Harris",
        "given-name": "Oliver"
    }
    
  3. 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": "/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": "/profiles/mobee/gy3ukmrygbaugljxiu4dmljtgjatgljvhfbdeljwgeyemrrsinatgoceiq"
            }
        ]
    }