> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# GetGeneratedImage

# Package: socialMedia

# Namespace: GeneratedContentService

# Method link: https://dev.wix.com/docs/api-reference/business-management/marketing/social-media/generated-content-v1/get-generated-image.md

## Permission Scopes:
Manage Social Posts: SCOPE.PROMOTE.MANAGE-SOCIAL-POSTS

## Introduction

Retrieves the result of an asynchronous image-generation request.

Poll this with the `executionId` returned by Generate Image until the status is `READY`, when the generated image's `imageUrl` and `fileId` are populated, or `FAILED`.

---

## REST API

### Schema

```
 Method: getGeneratedImage
 Description: Retrieves the result of an asynchronous image-generation request.  Poll this with the `executionId` returned by Generate Image until the status is `READY`, when the generated image's `imageUrl` and `fileId` are populated, or `FAILED`.
 URL: https://www.wixapis.com/social-publisher/v1/generated-image/{executionId}
 Method: GET
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  executionId
 Method parameters: 
   param name: executionId | type:   none | required: true 
 Return type: GetGeneratedImageResponse
  - name: status | type: Status | description: Status of the image generation.  
     - enum:
     -     IN_PROGRESS: Generation is still in progress.
     -     READY: Generation completed and the image is available.
     -     FAILED: Generation failed.
  - name: imageUrl | type: string | description: URL of the generated image. Returned only when the status is `READY`.  | validation: format WEB_URL
  - name: fileId | type: string | description: Media Manager file GUID of the generated image. Returned only when the status is `READY`.  | validation: maxLength 1000

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: GENERATED_IMAGE_NOT_FOUND | Description: Couldn't find an image generation for the provided `executionId`. It's invalid or has expired.


```

### Examples

### Get a generated image
Retrieve the result of an image-generation request by its executionId. Poll until the status is READY or FAILED.

```curl
curl -X GET \
'https://www.wixapis.com/social-publisher/v1/generated-image/b7c2f0a1-4e6d-4a8b-9c3f-2d5e1a7b0c94' \
-H 'Authorization: <AUTH>'
```

---

## JavaScript SDK

### Schema

```
 Method: wixClientAdmin.promoteGrowthToolsPublisher.generatedContent.getGeneratedImage(executionId)
 Description: Retrieves the result of an asynchronous image-generation request.  Poll this with the `executionId` returned by Generate Image until the status is `READY`, when the generated image's `imageUrl` and `fileId` are populated, or `FAILED`.
 # Note: If the parameter `a.b` is listed under required parameters, `b` is only required if `a` is also present.
 Required parameters:  executionId
 Method parameters: 
   param name: executionId | type: string | description: The image-generation process GUID returned by Generate Image. | required: true | validation: maxLength 1000
 Return type: PROMISE<GetGeneratedImageResponse>
  - name: status | type: Status | description: Status of the image generation.  
     - enum:
     -     IN_PROGRESS: Generation is still in progress.
     -     READY: Generation completed and the image is available.
     -     FAILED: Generation failed.
  - name: imageUrl | type: string | description: URL of the generated image. Returned only when the status is `READY`.  | validation: format WEB_URL
  - name: fileId | type: string | description: Media Manager file GUID of the generated image. Returned only when the status is `READY`.  | validation: maxLength 1000

 Possible Errors:
   HTTP Code: 404 | Status Code: NOT_FOUND | Application Code: GENERATED_IMAGE_NOT_FOUND | Description: Couldn't find an image generation for the provided `executionId`. It's invalid or has expired.


```

### Examples

### Get a generated image
```javascript
import { generatedContent } from "@wix/promote-growth-tools-publisher";

const executionId = "b7c2f0a1-4e6d-4a8b-9c3f-2d5e1a7b0c94";

async function getGeneratedImage() {
  const response = await generatedContent.getGeneratedImage(executionId);
}

/* Promise resolves to:
 * {
 *   "status": "READY",
 *   "imageUrl": "https://static.wixstatic.com/media/cf2434_generated-image.jpg",
 *   "fileId": "cf2434_abc123def456~mv2.jpg"
 * }
 */

```

### getGeneratedImage (self-managed)
Self-managed SDK calls require you to [create a client](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-the-wix-client.md).

```javascript
import { createClient } from '@wix/sdk';
import { generatedContent } from '@wix/promote-growth-tools-publisher';
// Import the auth strategy for the relevant access type
// Import the relevant host module if needed

const myWixClient = createClient ({
  modules: { generatedContent },
  // Include the auth strategy and host as relevant
});


async function getGeneratedImage(executionId) {
  const response = await myWixClient.generatedContent.getGeneratedImage(executionId);
};
```

---