0

Lets say we have 2 resources with relation such as:

  1. Creative
  2. Organization

Each creation attempt can start with:

  1. Creation of an Organization
  2. Creation of a Creative

But if user already has an Organization, can skip the creation of Organization and use that. How would I generate links for my entry point?

{
  "_links": {
    "self": { "href": "https://myorg.com/myapi" },
    "curies": [{ "name": "myorg", "href": "https://myorg.com/docs/myapi/{rel}" }],
    "myorg:organizations": { "href": "https://myorg.com/myapi/organizations" },
    "myorg:creatives": { "href": "https://myorg.com/myapi/creatives" }
  },
  "_embedded": {}
}

This is my current entry point response.

  1. How can I specify two creation step as entry point?
  2. Should I just omit Creatives in my entry point response?

Below is my other two resource definitions:

Organizations

{
  "_links": {
    "self": { "href": "https://myorg.com/myapi/organizations" },
    "help": { "href": "https://myorg.com/docs/myapi/organizations" },
  },
  "_embedded": {
    "item": [{ 
      "_links": {
        "self": { "href": "https://myorg.com/myapi/organizations/12345" },
        "help": { "href": "https://myorg.com/docs/myapi/organizations/12345" },
      },
      "_id": "12345", 
      "value": "E15B23FFF"
    },...]
  }
}

Creatives

{
  "_links": {
    "self": { "href": "https://myorg.com/myapi/creatives" },
    "help": { "href": "https://myorg.com/docs/myapi/creatives" },
  },
  "_embedded": {
    "item": [{
      "_links": {
        "self": { "href": "https://myorg.com/myapi/creatives/54321" },
        "help": { "href": "https://myorg.com/docs/myapi/creatives/54321" },
      },
      "_embedded": {
        "organization": { 
          "_links": {
            "self": { "href": "https://myorg.com/myapi/organizations/12345" },
            "help": { "href": "https://myorg.com/docs/myapi/organizations/12345" }
          },
          "_id": "12345",
          "value": "E15B23FFF"
        },
      },
      "_id": "54321",
      "status": "processing"
  }, ...]
  }
}
Yakup Türkan
  • 576
  • 2
  • 6
  • 21

0 Answers0