public void WeChatApiTagsTest() { Assert.AreEqual(JsonCreate.Create("广东"), "{\"tag\":{\"name\":\"广东\"}}"); Assert.AreEqual(JsonCreate.Update(134, "广东人"), "{\"tag\":{\"id\":134,\"name\":\"广东人\"}}"); Assert.AreEqual(JsonCreate.Delete(134), "{\"tag\":{\"id\":134}}"); Assert.AreEqual(JsonCreate.GetUsers(134), "{\"tagid\":134,\"next_openid\":\"\"}"); Assert.AreEqual(JsonCreate.GetUsers(134, "test"), "{\"tagid\":134,\"next_openid\":\"test\"}"); Assert.AreEqual(JsonCreate.GetIdList("test"), "{\"openid\":\"test\"}"); //Config = new Api.Config("gh_69438e79ea75", "wx95dfa97f9fca2358", "4e053f53f278347179416898e3d7883a"); //var token = Api.GetAccessToken(Config); //var create = Api.Tags.Create(token, "测试"); //var tags = Api.Tags.Get(token); //var update = Api.Tags.Update(token, create.id, "test"); //tags = Api.Tags.Get(token); //var del = Api.Tags.Delete(token, create.id); //tags = Api.Tags.Get(token); //var users = Api.Tags.GetUsers(token, tags[0].id); //var ids = Api.Tags.GetIdList(token, "oOk2XjhrbcHP3tGgzDGAVHppo3Bs"); }
public static int[] GetIdList(string access_token, string openid) => ApiPost <UserInfo>(JsonCreate.GetIdList(openid), "/cgi-bin/tags/getidlist?access_token={0}", access_token).tagid_list;