# API 2 Documentation?

**URL:** <https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469>\
**Category:** UXP Plugin API\
**Created:** [August 8, 2021, 10:34pm UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469 "2021-08-08T22:34:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [August 8, 2021, 10:34pm UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469/1 "2021-08-08T22:34:01Z")

</div>

A month or so ago I saw some documentation on the API version 2 and using executeAsModal with a single history state. I can’t find the documentation for this anymore and lost the bookmark I had for it. Could someone post a link for where to find the API 2 documentation?

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [August 9, 2021, 1:07am UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469/2 "2021-08-09T01:07:24Z")

</div>

OK, so I found the link but it now gives a 404 error. I can’t find any documents at all for SPI version 2. Was all the documentation removed? Or was it moved somewhere else?

[https://www.stage.adobe.io/photoshop/uxp/ps\_reference/media/executeAsModal/](https://www.stage.adobe.io/photoshop/uxp/ps_reference/media/executeAsModal/)

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [August 9, 2021, 6:08am UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469/3 "2021-08-09T06:08:35Z")

</div>

These stage links are not working most of the time, so might again be temporary

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [August 9, 2021, 3:49pm UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469/4 "2021-08-09T15:49:24Z")

</div>

Please try again – should be working again.

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [August 9, 2021, 6:12pm UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469/5 "2021-08-09T18:12:29Z")

</div>

It is working, thanks.

For the API 2, is that going to be in the public release of 22.5? I’m assuming whatever is in the beta will also be in the public release? For my next UXP release, I want to just build it using API 2 and release with the min version set to 22.5.

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [August 9, 2021, 11:33pm UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469/6 "2021-08-09T23:33:39Z")

</div>

Just to confirm, is the API 2 functional yet in the 22.5 beta release?

When switching to API 2 in the manifest, I can’t get the plugin to do anything… not even do a basic app.showAlert.

Before I start to troubleshoot, I just want to ensure that that the API 2 is functional so I don’t spend a bunch of time troubleshooting if it the API is not functional yet.

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [August 10, 2021, 1:29am UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469/7 "2021-08-10T01:29:04Z")

</div>

OK, I figured out some things about API 2. So in case this helps someone else…

1. You must use executeAsModal. It’s not optional to be able to just run batchPlay without it… at least I don’t think it is.

2. If you have your batchPlay setup with options, you must change modalBehavior to “execute” or just let it default. If you have it set to “fail” then it won’t work… which makes sense.

3. Showing an alert is now done this way  
`require('photoshop').core.showAlert("message");`

and not this way  
`require('photoshop').app.showAlert("message");`

---

<div class="post-metadata">

**Author:** ![Rammy](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/rammy/32/674_2.png) [@Rammy](https://forums.creativeclouddeveloper.com/u/Rammy)\
**Post date:** [November 2, 2021, 5:31pm UTC](https://forums.creativeclouddeveloper.com/t/api-2-documentation/3469/8 "2021-11-02T17:31:30Z")

</div>

Looks like this link went down again.  
[https://developer-stage.adobe.com/photoshop/uxp/2022/ps\_reference/media/executeasmodal/](https://developer-stage.adobe.com/photoshop/uxp/2022/ps_reference/media/executeasmodal/)

It’s linked here but 404s:  
[https://developer-stage.adobe.com/photoshop/uxp/2022/ps\_reference/](https://developer-stage.adobe.com/photoshop/uxp/2022/ps_reference/)

EDIT:  
Found it here!  
[https://www.adobe.io/photoshop/uxp/2022/ps\_reference/media/executeasmodal/](https://www.adobe.io/photoshop/uxp/2022/ps_reference/media/executeasmodal/)
