POST /compare/expand

POST /compare/expand

Expand comparison path into product references

Body Required

  • path string Required

    a comparison alias is composed of two product aliases separated by '-vs-'

Responses

POST /compare/expand
curl \
 -X POST https://api.cosmily.com/api/v1/compare/expand \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"path":"first_alias-vs-second_alias"}'
{
  "path": "first_alias-vs-second_alias"
}
{
  "path": "https://cosmily.com/some/path/to/compare/first_alias-vs-second_alias"
}
Request examples
{
  "path": "string"
}
Response examples (200)
{
  "data": {
    "left_product": {
      "id": 42,
      "alias": "string"
    },
    "right_product": {
      "id": 42,
      "alias": "string"
    },
    "comparison_alias": "string"
  },
  "links": {
    "left_product": "string",
    "right_product": "string",
    "left_analysis": "string",
    "right_analysis": "string"
  }
}
Response examples (200)
{
  "data": {
    "left_product": {
      "id": 42,
      "alias": "string"
    },
    "right_product": {
      "id": 42,
      "alias": "string"
    },
    "comparison_alias": "string"
  },
  "links": {
    "left_product": "string",
    "right_product": "string",
    "left_analysis": "string",
    "right_analysis": "string"
  }
}