facebook / facebook-java-business-sdk

Java SDK for Meta Marketing APIs
https://developers.facebook.com/docs/business-sdk
Other
393 stars 324 forks source link

I still failed to create an ad by adding the enroll_status parameter through the SDK with the v17 version API. #423

Closed pop-lee closed 1 year ago

pop-lee commented 1 year ago

Which SDK version are you using?

V16.0.2

What's the issue?

Based on the existing version 16.0.2 of the SDK, I added the parameter standard_enhancements > enroll_status > OPT_OUT but I still failed to create an ad. Part of the request parameters are as follows:

{
  "object_story_spec": {
    "page_id": "xxxxx",
    "video_data": {
      "call_to_action": {
        "type": "INSTALL_APP",
        "value": {
          "link": ""
        }
      },
      "image_hash": "{result=videoThumbnailRequestxxxxxxxxxxxxx:$.images.*.hash}",
      "title": "",
      "video_id": "{result=videoRequestxxxxxxxxxxxxx:$.id}"
    }
  },
  "title": "素材标题",
  "body": "素材内容",
  "degrees_of_freedom_spec": {
    "creative_features_spec": {
      "standard_enhancements": {
        "enroll_status": "OPT_OUT"
      }
    }
  }
}

The error is as follows:

[
  {
    "error": {
      "message": "Invalid parameter",
      "type": "OAuthException",
      "code": 100,
      "error_subcode": 3858082,
      "is_transient": false,
      "error_user_title": "Creative Must Provide enroll_status for Standard Enhancements",
      "error_user_msg": "This creative is eligible for Standard Enhancements, but enroll_status was not provided. Please choose whether you want to turn on standard enhancements or not. Learn more here: https://fburl.com/hyth50xo",
      "fbtrace_id": "AZGGOCEVV3jyJ09T0SV0yXO"
    }
  },
  {
    "error": {
      "message": "Request aborted. This could happen if a dependent request failed or the entire request timed out.",
      "type": "FacebookApiException",
      "code": 960,
      "fbtrace_id": "A1m-jT3shoLxOqMFdVxhxdU"
    }
  }
]

What could be the possible reason and how to solve it?

stcheng commented 1 year ago

closing this as a duplicate issue of https://github.com/facebook/facebook-java-business-sdk/issues/422 that has been closed.