Skip to content

Add support for threads_user_id to AdSet, AdCreative, and related cla…#501

Open
arnabnandy7 wants to merge 1 commit into
facebook:mainfrom
arnabnandy7:feature/threads-user-id
Open

Add support for threads_user_id to AdSet, AdCreative, and related cla…#501
arnabnandy7 wants to merge 1 commit into
facebook:mainfrom
arnabnandy7:feature/threads-user-id

Conversation

@arnabnandy7

Copy link
Copy Markdown

Description

This PR resolves the issue where threads_user_id was not supported as a direct field, query/request parameter, or getter/setter in the Java Business SDK. We have added full support for threads_user_id across the SDK in the same locations where instagram_user_id is supported, allowing developers to target and manage placements on the Threads platform directly instead of relying on setting it as a miscellaneous/custom field.

Key Changes

SDK Models

  • AdSet:
    • Added @SerializedName("threads_user_id") field and member variable mThreadsUserId.
    • Added getFieldThreadsUserId() and setFieldThreadsUserId(String value).
    • Added "threads_user_id" to FIELDS array in APIRequestGetAdCreatives, APIRequestGetCopies, and APIRequestGet.
    • Added requestThreadsUserIdField methods to APIRequestGetAdCreatives, APIRequestGetCopies, and APIRequestGet.
  • AdCreative:
    • Added @SerializedName("threads_user_id") field and member variable mThreadsUserId.
    • Added getFieldThreadsUserId() and setFieldThreadsUserId(String value).
    • Added "threads_user_id" to FIELDS array in APIRequestGet.
    • Added requestThreadsUserIdField methods to APIRequestGet.
    • Assigned mThreadsUserId in the copyFrom copy-constructor method.
  • AdCreativeObjectStorySpec:
    • Added @SerializedName("threads_user_id") field and member variable mThreadsUserId.
    • Added getFieldThreadsUserId() and setFieldThreadsUserId(String value).
    • Assigned mThreadsUserId in the copyFrom copy-constructor method.
  • Ad:
    • Added "threads_user_id" to FIELDS array and added requestThreadsUserIdField methods to APIRequestGetAdCreatives.

API & Endpoint Requests

  • AdAccount:
    • Added "threads_user_id" to FIELDS array and added requestThreadsUserIdField methods in:
      • APIRequestGetAdCreatives
      • APIRequestGetAdCreativesByLabels
      • APIRequestGetAdSets
      • APIRequestGetAdSetsByLabels
      • APIRequestGetAffectedAdSets
      • APIRequestGetDeprecatedTargetingAdSets
    • Added "threads_user_id" to PARAMS array and added setThreadsUserId(String threadsUserId) to APIRequestCreateAdCreative.
  • Campaign:
    • Added "threads_user_id" to FIELDS array and added requestThreadsUserIdField methods to APIRequestGetAdSets.
  • AdLabel:
    • Added "threads_user_id" to FIELDS array and added requestThreadsUserIdField methods to APIRequestGetAdCreatives and APIRequestGetAdSets.
  • AdStudyCell:
    • Added "threads_user_id" to FIELDS array and added requestThreadsUserIdField methods to APIRequestGetAdSets.

Verification Done

  • Verified that all 1,041 Java files compile successfully with javac after the additions.

Resolves #497

…sses

Add threads_user_id as a first-class field, query/request parameter, and getter/setter across the SDK, aligning with how instagram_user_id is currently supported.

- AdSet: added mThreadsUserId field, getter/setter, and added to FIELDS/requests in APIRequestGetAdCreatives, APIRequestGetCopies, and APIRequestGet.
- AdCreative: added mThreadsUserId field, getter/setter, APIRequestGet, and copied in copyFrom.
- AdCreativeObjectStorySpec: added mThreadsUserId field, getter/setter, and copied in copyFrom.
- Ad: added threads_user_id to FIELDS and requests in APIRequestGetAdCreatives.
- AdAccount: added threads_user_id to FIELDS and requests in APIRequestGetAdCreatives, APIRequestGetAdCreativesByLabels, APIRequestGetAdSets, APIRequestGetAdSetsByLabels, APIRequestGetAffectedAdSets, and APIRequestGetDeprecatedTargetingAdSets. Added threads_user_id to PARAMS and setThreadsUserId to APIRequestCreateAdCreative.
- Campaign: added threads_user_id to FIELDS and requests in APIRequestGetAdSets.
- AdLabel: added threads_user_id to FIELDS and requests in APIRequestGetAdCreatives and APIRequestGetAdSets.
- AdStudyCell: added threads_user_id to FIELDS and requests in APIRequestGetAdSets.

Resolves facebook#497
@meta-cla meta-cla Bot added the CLA Signed label Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No methods for get or set FieldThreadsUserId in Ad or AdSet

1 participant