public void WeChatApiTagsMembersTest()
            {
                var taggingRequest = "{\"openid_list\":[\"ocYxcuAEy30bX0NXmGn4ypqx3tI0\",\"ocYxcuBt0mRugKZ7tGAHPnUaOW7Y\"],\"tagid\":134}";

                Assert.AreEqual(JsonCreate.BatchTagging(134, new List <string>()
                {
                    "ocYxcuAEy30bX0NXmGn4ypqx3tI0",
                    "ocYxcuBt0mRugKZ7tGAHPnUaOW7Y"
                }), taggingRequest);
                Assert.AreEqual(JsonCreate.BatchUntagging(134, new List <string>()
                {
                    "ocYxcuAEy30bX0NXmGn4ypqx3tI0",
                    "ocYxcuBt0mRugKZ7tGAHPnUaOW7Y"
                }), taggingRequest);

                Assert.AreEqual(JsonCreate.GetBlackList("OPENID1"), "{\"begin_openid\":\"OPENID1\"}");

                var blackRequest = "{\"openid_list\":[\"OPENID1\",\"OPENID2\"]}";

                Assert.AreEqual(JsonCreate.BatchBlackList(new List <string>()
                {
                    "OPENID1", "OPENID2"
                }), blackRequest);
                Assert.AreEqual(JsonCreate.BatchUnblackList(new List <string>()
                {
                    "OPENID1", "OPENID2"
                }), blackRequest);

                //Config = new Api.Config("gh_69438e79ea75", "wx95dfa97f9fca2358", "4e053f53f278347179416898e3d7883a");
                //var openid = "oOk2XjhrbcHP3tGgzDGAVHppo3Bs";
                ////openid = "okOeUwaD9TRRqFh_hyE4xlMwBg8Y";
                //var token = Api.GetAccessToken(Config);
                //var tagging = Api.Tags.Members.BatchTagging(token, 2, openid);
                //var users = Api.Tags.GetUsers(token, 2);
                //var ids = Api.Tags.GetIdList(token, openid);
                //var untagging = Api.Tags.Members.BatchUntagging(token, 2, openid);
                //var blacklist = Api.Tags.Members.GetBlackList(token);
                //var black = Api.Tags.Members.BatchBlackList(token, openid);
                //blacklist = Api.Tags.Members.GetBlackList(token);
                //var unblack = Api.Tags.Members.BatchUnblackList(token, openid);
                //blacklist = Api.Tags.Members.GetBlackList(token);
            }
Example #2
0
 public static UsersQuery GetBlackList(string access_token, string begin_openid = null) =>
 ApiPost <UsersQuery>(JsonCreate.GetBlackList(begin_openid), "/cgi-bin/tags/members/getblacklist?access_token={0}", access_token);