> For the complete documentation index, see [llms.txt](https://speaking-test-docs.speechace.com/speechace-speaking-test/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://speaking-test-docs.speechace.com/speechace-speaking-test/speechace-workspaces-create-manage-and-share-speaking-assessments/embedding-assessments-in-other-apps-and-websites/oembed-integration-for-speechace-speaking-test/receiving-test-results-on-specified-callback/test-completion-notification-to-3rd-party-app-front-end.md).

# Test completion notification to 3rd party app front-end

When 3rd party apps embed the speaking test in a child iframe, they often need to know the test completion status so that users can be shown ancillary UX such as a Next or Continue button. One way to determine test completion status is to query the 3rd party app backend to check if user has completed the test. Alternatively, 3rd party app front-ends can also listen to a test completion status event, which is raised every time the speaking test is loaded in a child iframe.

To listen to the test completion status event, the 3rd party app can listen to events in the parent (iframe host) window using the below javascript event listener:

```
window.addEventListener('message', function(event) { 
    console.log("Message received in parent", event); }
    );
```

Now whenever the speaking test is complete, the speaking test child iframe raises an event to the parent window using the below javascript code:

```
window.parent.postMessage('speechaceActivityComplete', "*").
```

Based on the above listener implementation, this will trigger the following console message in the parent's browser console window:

MessageEvent {\
&#x20;   isTrusted: true, \
&#x20;   data: 'speechaceActivityComplete', \
&#x20;   origin: '<https://speak.speechace.co>', lastEventId: '', \
&#x20;   source: global, …\
}

Now 3rd party apps can further enhance the listener to take custom action in their front-end.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://speaking-test-docs.speechace.com/speechace-speaking-test/speechace-workspaces-create-manage-and-share-speaking-assessments/embedding-assessments-in-other-apps-and-websites/oembed-integration-for-speechace-speaking-test/receiving-test-results-on-specified-callback/test-completion-notification-to-3rd-party-app-front-end.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
