Configure Default Message
Configures a default message for a specific product in a specific locale.
URL
PUT https://api.storekit.apple.com/inApps/v1/messaging/default/{productId}/{locale}Sandbox URL
PUT https://api.storekit-sandbox.apple.com/inApps/v1/messaging/default/{productId}/{locale}Path Parameters
| Name | Type | Description |
|---|---|---|
locale Required | locale | The locale for the default configuration. |
productId Required | productId | The product identifier for the default configuration. |
Response Codes
| Status | Reason | Type | Description |
|---|---|---|---|
| 200 | OK | Request succeeded. | |
| 400 | Bad Request Content-Type: application/json | (InvalidProductIdError | InvalidLocaleError) | The request is invalid and unacceptable. |
| 401 | Unauthorized | The JSON Web Token (JWT) in the authorization header is invalid. For more information, see Generating JSON Web Tokens for API requests. | |
| 403 | Forbidden Content-Type: application/json | (MessageNotApprovedError | ImageNotApprovedError) | The provided message or image isn’t in an approved state, so you can’t configure it as a default message. |
| 404 | Not Found Content-Type: application/json | MessageNotFoundError | The system can’t find the message. |
| 429 | Content-Type: application/json | RateLimitExceededError | The request exceeded the rate limit. For more information, see Identifying rate limits. |
| 500 | Internal Server Error Content-Type: application/json | GeneralInternalError | Server error. Try again later. |
Mentioned in
Discussion
When this request succeeds, the system configures the retention message you specify in the request body as the default message for productId in locale. You can configure a default message for every auto-renewable subscription’s product ID in every locale for your app.
You can configure only text-based messages and text-based messages with an image as a default message. Call Get Message List and Get Image List to check the current state of messages and images, respectively.
To replace a default message, call this endpoint again with a different message identifier. This endpoint is idempotent. If the product already has a default message for the locale, the endpoint overwrites that configuration and responds with a 200 status code.
To delete a default message, call Delete Default Message.
Use default messages
Configure a default message for each product in each locale. If you implement the Get Retention Message endpoint, the system requires a default message for every product in each locale where you provide real-time retention messages. For more information, see Setting up your Get Retention Message endpoint.
The system uses the default messages if your server response fails for any reason, or if you don’t implement the Get Retention Message endpoint.
To present promotional-offer or switch-plan retention messages instead of default messages, implement the Get Retention Message endpoint to respond with those message types in real time. For more information, see Setting up your Get Retention Message endpoint.
HTTP Body
The request body that includes the message identifier to configure as the default message.