Dear Team TwitterDev,

Just ask, now we’re currently using AAAPI but;

  • we can’t subscribe account handle to our webhoke
  • we can’t chek how number handle on our webhook but we can chek it before (respond 401)
  • can’t delete subscribe (response code = 403, sould be 200 )
  • this is responses when we chek numbers of subscribe {“errors”:[{“code”:220,“message”:“Your credentials do not allow access to this resource”}]}
  • Our AppID: 15861032

And now our Apps has been suspended.

Based on the description of your application, this may have been caught for a violation of the automation policy. You’ll need to raise a ticket via the API Policy support form to have this reviewed.

Regarding the AA API issues, once you’ve got write permissions again, we can look into that with you. Do you have any code examples describing the endpoints you were hitting and how you were calling them?

Hi!

we have received write permission again, but this time we get a new error message as follows.

{“errors”:[{“code”:“UNAUTHORIZED_ACCESS”,“message”:“This request is not properly authenticated”}],“request”:{“params”:{}}}

How are you trying to authorize it? Can you share a code snippet?

Hi, here our code

public synchronized String sendPromotableTweet( String tweet,String mediaIds) throws Exception {
		String url = "https://ads-api.twitter.com/4/accounts/" + this.streamPromotable.getAccountCardId() + "/tweet";

		OAuthConsumer oauthConsumer = new CommonsHttpOAuthConsumer(
				this.streamPromotable.getConsumerKey(),
				this.streamPromotable.getConsumerSecret());
		oauthConsumer.setTokenWithSecret(this.streamPromotable.getAccessToken(),
				this.streamPromotable.getTokenSecret());
		String obj = "";
		BufferedReader reader = null;
		try {
			//JSONObject jreq = new JSONObject();
			//jreq.put("text", tweet);
			//jreq.put("as_user_id", streamPromotable.getTwitterId());
			//jreq.put("trim_user", true);
			//String request = jreq.toString();
			
			log.info("sent "+streamPromotable.getTwitterId());

			List<NameValuePair> params = new ArrayList();
			params.add(new BasicNameValuePair("text", tweet));
			//params.add(new BasicNameValuePair("as_user_id", userId + ""));
			params.add(new BasicNameValuePair("as_user_id", streamPromotable.getTwitterId() + ""));
			
			params.add(new BasicNameValuePair("trim_user", "true"));
			
			if(!mediaIds.isEmpty()) {
				params.add(new BasicNameValuePair("media_ids", mediaIds));
			}

			this.log.info("request sendPromotableTweet " + " media_ids="+mediaIds);
			HttpPost httpPost = new HttpPost(url);

			httpPost.setEntity(new UrlEncodedFormEntity(params));
			oauthConsumer.sign(httpPost);

			HttpResponse httpResponseInit = this.httpClient.execute(httpPost);
			this.log.info(
					"status welcome message default code init : " + httpResponseInit.getStatusLine().getStatusCode());

			reader = new BufferedReader(new InputStreamReader(httpResponseInit.getEntity().getContent()));

			
			String str;
			while ((str = reader.readLine()) != null) {
				obj = obj + str;
			}
			if (reader != null) {
				reader.close();
			}
			this.log.info("result " + obj);
		} catch (Exception ex) {
			ex.printStackTrace();
			this.log.error(com.gdilab.autoresponse.core.util.Utils.logException(ex));
			throw ex;
		}
		
		return obj;
	}

I’m confused - this seems to be Ads API code, and not related to the Account Activity API?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.