Save image and then retrieve via client side

I am trying the approach right now, bearer token should be private too, right?
I am fetching 403 error with nodejs, let me work further and I will giving feed back.

Always, appreciate your help.

I got the server response, how do I fetch the snapshot at the json file? :slight_smile:
@Will

Great! When you POST to the asset-jobs API it will return you an object like this:

    "files": [
        "ddd5ef25-8692-4803-b827-fbd805aea778"
    ],
    "fileId": "ddd5ef25-8692-4803-b827-fbd805aea778",
    "jobId": "e4692b9d-426a-4810-9739-277958b3eda1",
    "job": {
        "_id": "e4692b9d-426a-4810-9739-277958b3eda1",
        "runs": [
            {
                "results": {
                    "files": [
                        {
                            "id": "ddd5ef25-8692-4803-b827-fbd805aea778"
                        }
                    ]
                }
            }
        ]
    }
}

the ID that is in the files array is the FileID that you just created. If you would like to see the information on that file, you can use that ID in an endpoint like this:
https://preview.threekit.com/api/files/${FILE_ID} which will give you JSON about the file:

{
"id": "ddd5ef25-8692-4803-b827-fbd805aea778",
"userId": null,
"filename": "Golf Bag.png",
"createdAt": "2021-08-26T20:08:59.228Z",
"size": 91894,
"hash": "sha256-58fc0f0896d2c470cc9334d5686a9ecaa030e27e5bea18459c6497f49f3c59e9",
"extension": ".png",
"encodings": {
"raw": {
"size": 91894
}
},
"orgId": "e07b8a6e-2281-4173-99ee-088c67fc745c",
"mimeType": "image/png"
}

and to get the image itself, use the same endpoint but add /content to the end.
https://preview.threekit.com/api/files/${FILE_ID}/content

Here is a render I just created:
https://preview.threekit.com/api/files/ddd5ef25-8692-4803-b827-fbd805aea778/content

Thank you very much

Now I can finish to construct the logic, 100k kudos to you :smiley:

CM.

1 Like

Fantastic! Please feel free to reach out if you have any additional questions.

1 Like