# Can I work with Relationships of Relationships?

**URL:** <https://discuss.jsonapi.org/t/can-i-work-with-relationships-of-relationships/790>\
**Category:** Uncategorized\
**Created:** [October 6, 2016, 1:40pm UTC](https://discuss.jsonapi.org/t/can-i-work-with-relationships-of-relationships/790 "2016-10-06T13:40:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![danilovaz](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/danilovaz/32/337_2.png) [@danilovaz](https://discuss.jsonapi.org/u/danilovaz)\
**Post date:** [October 6, 2016, 1:40pm UTC](https://discuss.jsonapi.org/t/can-i-work-with-relationships-of-relationships/790/1 "2016-10-06T13:40:34Z")

</div>

Hello, guys!

I have this scenario:

**Channel-Applications** belongsTo **Channel**  
**Channel-Applications** hasMany **Application-Features**  
**Application-Feature** belongsTo **Channel-Applications**  
**Application-Features** belongsTo **Features**  
**Channel** hasMany **Features**  
**Feature** hasMany **Application-Features**  
**Feature** hasMany **Channels**

And that’s the return of my API:

```
{
   "data":[
      {
         "type":"channel-applications",
         "id":"2",
         "attributes":{
            "name":"Application1",
            "channel-id":1,
            "client-id":"123"
         },
         "relationships":{
            "application-features":{
               "data":[
                  {
                     "type":"application-features",
                     "id":"3"
                  }
               ]
            }
         }
      },
      {
         "type":"channel-applications",
         "id":"4",
         "attributes":{
            "name":"Application2",
            "channel-id":2,
            "client-id":"456"
         },
         "relationships":{
            "application-features":{
               "data":[
                  {
                     "type":"application-features",
                     "id":"7"
                  }
               ]
            }
         }
      },
      {
         "type":"channel-applications",
         "id":"5",
         "attributes":{
            "name":"Application3",
            "channel-id":3,
            "client-id":"001"
         },
         "relationships":{
            "application-features":{
               "data":[
                  {
                     "type":"application-features",
                     "id":"9"
                  },
                  {
                     "type":"application-features",
                     "id":"10"
                  },
                  {
                     "type":"application-features",
                     "id":"11"
                  },
                  {
                     "type":"application-features",
                     "id":"12"
                  }
               ]
            }
         }
      }
   ],
   "included":[
      {
         "type":"application-features",
         "id":"3",
         "attributes":{
            "channel-application-id":2,
            "feature-id":3,
            "scope":"teste1, teste2, teste3",
            "connect-type":"script"
         }
      },
      {
         "type":"application-features",
         "id":"7",
         "attributes":{
            "channel-application-id":4,
            "feature-id":3,
            "scope":"",
            "connect-type":"redirect"
         }
      },
      {
         "type":"application-features",
         "id":"9",
         "attributes":{
            "channel-application-id":5,
            "feature-id":1,
            "scope":"teste4, teste5",
            "connect-type":"redirect"
         }
      },
      {
         "type":"application-features",
         "id":"10",
         "attributes":{
            "channel-application-id":5,
            "feature-id":2,
            "scope":"",
            "connect-type":"password"
         }
      },
      {
         "type":"application-features",
         "id":"11",
         "attributes":{
            "channel-application-id":5,
            "feature-id":3,
            "scope":"",
            "connect-type":"password"
         }
      },
      {
         "type":"application-features",
         "id":"12",
         "attributes":{
            "channel-application-id":5,
            "feature-id":4,
            "scope":"",
            "connect-type":"password"
         }
      }
   ]
}

```

**My questions:** My structure is correctly? My included is correctly? May I have to use Included or Links (related/self)?
