Skip to content

Commit dea9871

Browse files
author
Dale Myers
committed
Use new submit for review API
1 parent 320e6a7 commit dea9871

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ version = client.app.create_new_version(version="1.2.3", app_id=app.identifier)
6666
client.version.set_build(version_id=version.identifier, build_id=build.identifier)
6767

6868
# Submit for review
69-
client.version.submit_for_review(version_id=version.identifier)
69+
client.version.submit_for_review(version_id=version.identifier, platform=Platform.IOS)
7070
```
7171

7272
It's that easy. Most of the time at least. If you don't have previous version to inherit information from you'll need to do things like set screenshots, reviewer info, etc. All of which is possible through this library.

asconnect/version_client.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -439,30 +439,29 @@ def set_uses_idfa(
439439
def submit_for_review(
440440
self,
441441
*,
442-
version_id: str,
442+
app_id: str,
443+
platform: Platform,
443444
max_attempts: int = 3,
444445
) -> None:
445446
"""Submit the version for review
446447
447-
:param version_id: The ID of the version to submit for review
448+
:param app_id: The ID of the app to submit for review
449+
:param platform: The platform to submit for review
448450
:param max_attempts: The number of attempts allowed
449451
450452
:raises AppStoreConnectError: If runs into unretriable error or exceeds retry count
451453
"""
452454

453455
try:
454-
self.log.info(f"Submitting version for review {version_id}")
456+
self.log.info(f"Submitting app for review {app_id}")
455457

456458
self.http_client.post(
457-
endpoint="appStoreVersionSubmissions",
459+
endpoint="reviewSubmissions",
458460
data={
459461
"data": {
460-
"type": "appStoreVersionSubmissions",
461-
"relationships": {
462-
"appStoreVersion": {
463-
"data": {"type": "appStoreVersions", "id": version_id}
464-
}
465-
},
462+
"type": "reviewSubmissions",
463+
"attributes": {"platform": platform.value},
464+
"relationships": {"app": {"data": {"type": "apps", "id": app_id}}},
466465
}
467466
},
468467
log_response=True,
@@ -478,7 +477,9 @@ def submit_for_review(
478477
f"Submit failed due to server-side intermittent issue. Will sleep for 1 minute and try again, left attempt: {max_attempts - 1}."
479478
)
480479
time.sleep(60)
481-
self.submit_for_review(version_id=version_id, max_attempts=max_attempts - 1)
480+
self.submit_for_review(
481+
app_id=app_id, platform=platform, max_attempts=max_attempts - 1
482+
)
482483
else:
483484
raise # Re-raise the caught exception
484485

0 commit comments

Comments
 (0)