Skip to content

Commit a330d61

Browse files
Merge pull request #198 from alexanderjordanbaker/RetentionMessaging1.1
Add support for the Retention Messaging API 1.0-1.1 https://developer…
2 parents fc4e2d2 + aed5ed7 commit a330d61

34 files changed

+2502
-25
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Apple App Store Server Java Library
2-
The Java server library for the [App Store Server API](https://developer.apple.com/documentation/appstoreserverapi) and [App Store Server Notifications](https://developer.apple.com/documentation/appstoreservernotifications). Also available in [Swift](https://github.com/apple/app-store-server-library-swift), [Python](https://github.com/apple/app-store-server-library-python), and [Node.js](https://github.com/apple/app-store-server-library-node).
2+
The Java server library for the [App Store Server API](https://developer.apple.com/documentation/appstoreserverapi), [App Store Server Notifications](https://developer.apple.com/documentation/appstoreservernotifications), and [Retention Messaging API](https://developer.apple.com/documentation/retentionmessaging). Also available in [Swift](https://github.com/apple/app-store-server-library-swift), [Python](https://github.com/apple/app-store-server-library-python), and [Node.js](https://github.com/apple/app-store-server-library-node).
33

44
## Table of Contents
55
1. [Installation](#installation)

src/main/java/com/apple/itunes/storekit/client/APIError.java

Lines changed: 99 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,41 @@ public enum APIError {
300300
*/
301301
APP_TRANSACTION_ID_NOT_SUPPORTED_ERROR(4000048L),
302302

303+
/**
304+
* An error that indicates the image that's uploading is invalid.
305+
*
306+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/invalidimageerror">InvalidImageError</a>
307+
*/
308+
INVALID_IMAGE(4000161L),
309+
310+
/**
311+
* An error that indicates the header text is too long.
312+
*
313+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/headertoolongerror">HeaderTooLongError</a>
314+
*/
315+
HEADER_TOO_LONG(4000162L),
316+
317+
/**
318+
* An error that indicates the body text is too long.
319+
*
320+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/bodytoolongerror">BodyTooLongError</a>
321+
*/
322+
BODY_TOO_LONG(4000163L),
323+
324+
/**
325+
* An error that indicates the locale is invalid.
326+
*
327+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/invalidlocaleerror">InvalidLocaleError</a>
328+
*/
329+
INVALID_LOCALE(4000164L),
330+
331+
/**
332+
* An error that indicates the alternative text for an image is too long.
333+
*
334+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/alttexttoolongerror">AltTextTooLongError</a>
335+
*/
336+
ALT_TEXT_TOO_LONG(4000175L),
337+
303338
/**
304339
* An error that indicates the app account token value is not a valid UUID.
305340
*
@@ -343,7 +378,42 @@ public enum APIError {
343378
FAMILY_SHARED_SUBSCRIPTION_EXTENSION_INELIGIBLE(4030007L),
344379

345380
/**
346-
* An error that indicates the App Store account wasn’t found.
381+
* An error that indicates when you reach the maximum number of uploaded images.
382+
*
383+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/maximumnumberofimagesreachederror">MaximumNumberOfImagesReachedError</a>
384+
*/
385+
MAXIMUM_NUMBER_OF_IMAGES_REACHED(4030014L),
386+
387+
/**
388+
* An error that indicates when you reach the maximum number of uploaded messages.
389+
*
390+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/maximumnumberofmessagesreachederror">MaximumNumberOfMessagesReachedError</a>
391+
*/
392+
MAXIMUM_NUMBER_OF_MESSAGES_REACHED(4030016L),
393+
394+
/**
395+
* An error that indicates the message isn't in the approved state, so you can't configure it as a default message.
396+
*
397+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/messagenotapprovederror">MessageNotApprovedError</a>
398+
*/
399+
MESSAGE_NOT_APPROVED(4030017L),
400+
401+
/**
402+
* An error that indicates the image isn't in the approved state, so you can't configure it as part of a default message.
403+
*
404+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/imagenotapprovederror">ImageNotApprovedError</a>
405+
*/
406+
IMAGE_NOT_APPROVED(4030018L),
407+
408+
/**
409+
* An error that indicates the image is currently in use as part of a message, so you can't delete it.
410+
*
411+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/imageinuseerror">ImageInUseError</a>
412+
*/
413+
IMAGE_IN_USE(4030019L),
414+
415+
/**
416+
* An error that indicates the App Store account wasn't found.
347417
*
348418
* @see <a href="https://developer.apple.com/documentation/appstoreserverapi/accountnotfounderror">AccountNotFoundError</a>
349419
*/
@@ -412,6 +482,34 @@ public enum APIError {
412482
*/
413483
TRANSACTION_ID_NOT_FOUND(4040010L),
414484

485+
/**
486+
* An error that indicates the system can't find the image identifier.
487+
*
488+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/imagenotfounderror">ImageNotFoundError</a>
489+
*/
490+
IMAGE_NOT_FOUND(4040014L),
491+
492+
/**
493+
* An error that indicates the system can't find the message identifier.
494+
*
495+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/messagenotfounderror">MessageNotFoundError</a>
496+
*/
497+
MESSAGE_NOT_FOUND(4040015L),
498+
499+
/**
500+
* An error that indicates the image identifier already exists.
501+
*
502+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/imagealreadyexistserror">ImageAlreadyExistsError</a>
503+
*/
504+
IMAGE_ALREADY_EXISTS(4090000L),
505+
506+
/**
507+
* An error that indicates the message identifier already exists.
508+
*
509+
* @see <a href="https://developer.apple.com/documentation/retentionmessaging/messagealreadyexistserror">MessageAlreadyExistsError</a>
510+
*/
511+
MESSAGE_ALREADY_EXISTS(4090001L),
512+
415513
/**
416514
* An error that indicates that the request exceeded the rate limit.
417515
*

src/main/java/com/apple/itunes/storekit/client/AppStoreServerAPIClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected HttpResponseInterface makeRequest(String path,
5858
Map<String, List<String>> queryParameters,
5959
Map<String, String> headers,
6060
String contentType,
61-
String body) throws IOException {
61+
byte[] body) throws IOException {
6262
Request.Builder requestBuilder = new Request.Builder();
6363
headers.forEach(requestBuilder::addHeader);
6464
HttpUrl.Builder urlBuilder = Objects.requireNonNull(urlBase.resolve(path)).newBuilder();

0 commit comments

Comments
 (0)