Mark messages as read
PUT /v2/post_checkout/chat/{order_id}/messages
Marks all the non-read messages sent by the shopper.
Security
| Name | In | Description | 
|---|---|---|
| Authorization | header | The Authorization header with the bearer token acquired during authentication. | 
Parameters
| Name | In | Type | Required | Description | 
|---|---|---|---|---|
| order_id | path | string |  | The ID of the order. | 
| X-Treat-Ids-As-Internal | header | boolean |  | 
Request
None.
Request examples
- cURL
- Java
- Python
- Go
curl --request PUT \
  --url 'https://connect.instacart.com/v2/post_checkout/chat/{order_id}/messages' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Treat-Ids-As-Internal: true'
HttpResponse<String> response = Unirest.put("https://connect.instacart.com/v2/post_checkout/chat/{order_id}/messages")
  .header("Accept", "application/json")
  .header("Content-Type", "application/json")
  .header("Authorization", "Bearer <token>")
  .header("X-Treat-Ids-As-Internal", "true")
  .asString();
import http.client
conn = http.client.HTTPSConnection("connect.instacart.com")
headers = {
    'Accept': "application/json",
    'Content-Type': "application/json",
    'Authorization': "Bearer <token>",
    'X-Treat-Ids-As-Internal': "true"
    }
conn.request("PUT", "/v2/post_checkout/chat/{order_id}/messages", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
package main
import (
	"fmt"
	"net/http"
	"io/ioutil"
)
func main() {
	url := "https://connect.instacart.com/v2/post_checkout/chat/{order_id}/messages"
	req, _ := http.NewRequest("PUT", url, nil)
	req.Header.Add("Accept", "application/json")
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("X-Treat-Ids-As-Internal", "true")
	res, _ := http.DefaultClient.Do(req)
	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)
	fmt.Println(res)
	fmt.Println(string(body))
}
Response
| Field | Type | Required | Description | 
|---|---|---|---|
| messages_read_count | integer |  | The number of messages marked as read. | 
Response examples
200 Success
- 200Messages Read
{
  "messages_read_count": 15
}
4XX Errors
Error responses return either a single error or multiple errors.
| HTTP Code | Cause | Error Message | Error Code | Error Meta | 
|---|---|---|---|---|
| 404 | Order not found | "Resource not found" | 4000 | Not applicable |