Skip to main content
1 of 3
Damon
  • 4.7k
  • 1
  • 20
  • 36

Why is the summary and body returning an empty object using the Element API?

I'm not sure what I'm missing, but I'm getting an empty object back from the Element API for the summary and/or body for any given entry.

elementapi.php

...
'transformer' => function (EntryModel $entry) {
    return [
        'title' => $entry->title,
        'url' => $entry->url,
        'summary' => $entry->summary
    ];
},
...

Here is the json I am getting back:

{"data":[{"title":"My Title","url":"http:\/\/local.mysite.dev\/section\/my-entry","summary":{}}
Damon
  • 4.7k
  • 1
  • 20
  • 36