Skip to main content
Participating Frequently
August 19, 2021
Question

API request for smart obejct replacement

  • August 19, 2021
  • 2 replies
  • 551 views

Hi ~! I am new to this community and exploring different APIs provided.

 

I did succeed working with cutout using Sensei API, but I keep getting errors for the smart object one.

 

Does anybody know what I am doing wrong here?

 

{
  "inputs": [
    {
      "storage": "external",
      "href": <myRawGithubUserContent>
    }
  ],
  "options": {
    "layers": [
      {
        "id": 110,
        "name": "Layer 1",
        "locked": true,
        "visible": true,
        "add": {
          "insertAbove": {
            "id": 0,
            "name": "string"
          },
          "insertBelow": {
            "id": 0,
            "name": "string"
          },
          "insertInto": {
            "id": 0,
            "name": "string"
          },
          "insertTop": true,
          "insertBottom": true
        },
        "input": {
          "storage": "external",
          "href": "https://images.unsplash.com/photo-1481349518771-20055b2a7b24?ixid=MnwxMjA3fDB8MHxzZWFyY2h8M3x8cmFuZG9tfGVufDB8fDB8fA%3D%3D&ixlib=rb-1.2.1&w=1000&q=80"
        },
        "bounds": {
          "height": 4,
          "left": 0,
          "top": 0,
          "width": 4
        }
      }
    ]
  },
  "outputs": [
    {
      "href": "https://content.dropboxapi.com/apitul/1/my-path",
      "storage": "dropbox",
      "width": 0,
      "type": "image/jpeg",
      "overwrite": true,
      "compression": "small"
    }
  ]
}

 

I am getting the following errors.

 

{
  "code": 400,
  "invalidParams": [
    {
      "name": "outputs.0",
      "reason": "Must validate 'then' as 'if' was valid"
    },
    {
      "name": "outputs.0.compression",
      "reason": "Must not validate the schema (not)"
    },
    {
      "name": "outputs.0",
      "reason": "Must validate all the schemas (allOf)"
    }
  ],
  "title": "Invalid request parameters",
  "type": "InputValidationError"
}

 

Thanks for your help! 

This topic has been closed for replies.

2 replies

Kukurykus
Legend
August 20, 2021

Can you share how to use above code?

Participating Frequently
August 23, 2021

Hi!
Thanks for the reply! I got it working now.

I used the same example code from the API documentation page.

JJMack
Community Expert
Community Expert
August 23, 2021

I think you may have joined Adobe API beta Adobe I/O Program.   You should use the resources provided for that Group.  It is not public Photoshop users here have not knowledge about the API Adobe has in Adobe I/O

 

Photoshop API beta 

 

Photoshop API 

JJMack
Participating Frequently
August 19, 2021

Okay. I made it work now, but image is not replaced yet hmm...