admin管理员组文章数量:1295902
I'm experiencing issues with the Snapchat Marketing API when trying to upload members to a newly created Custom Audience segment. The segment is created successfully, but subsequent attempts to upload members result in a 404 "Resource not found" error, even after waiting.
Flow:
- Create a new segment (successful)
- Wait for segment to be ready (5 minutes)
- Attempt to upload members (fails with 404)
Create Segment Response (successful):
json
{
"request_status": "SUCCESS",
"segments": [{
"sub_request_status": "SUCCESS",
"segment": {
"id": "1234690325678104",
"name": "Test Audience 7",
"status": "ACTIVE",
"targetable_status": "NOT_READY",
"upload_status": "NO_UPLOAD"
}
}]
}
Upload Members Error Response:
`json
{
"request_status": "ERROR",
"request_id": "fac77e07-a307-503e-a641-6b95234a5e59",
"debug_message": "Resource can not be found",
"display_message": "Resource can not be found",
"error_code": "E3003"
}`
code:
java
// Create segment
Map<String, Object> segment = new HashMap<>();
segment.put("name", name);
segment.put("description", "Created via platform");
segment.put("source_type", "FIRST_PARTY");
segment.put("retention_in_days", 180);
segment.put("ad_account_id", adAccountId);
// Wait for segment to be ready
Thread.sleep(300000); // 5 minute delay
// Upload members
String endpoint = baseUrl + "/adaccounts/" + adAccountId + "/segments/" + segmentId + "/upload";
Map<String, Object> requestBody = new HashMap<>();
requestBody.put("audience", audienceMembers); // List of hashed emails
requestBody.put("segment_id", segmentId);
HttpEntity<Map<String, Object>> request = new HttpEntity<>(requestBody, headers);
ResponseEntity<Map> response = restTemplate.exchange(
endpoint,
HttpMethod.POST,
request,
Map.class
);`
- Added a 5-minute delay after segment creation
- Implemented retry logic (3 attempts with 30-second intervals)
- Verified the segment exists and checked its status before upload
- Confirmed all emails are properly SHA-256 hashed
- Verified authentication token is valid
本文标签:
版权声明:本文标题:java - Snapchat Marketing API - 404 Error when uploading members to a newly created Custom Audience segment - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741627278a2389158.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论