Example #1
0
        public static XElement UploadDocument(IMediaFile media)
        {
            var data = IssuuApi.NewQuery("issuu.document.upload");

            data.Add("name", media.GetName());
            data.Add("title", media.Title);
            IssuuApi.Sign(data);

            var document = GetDocument(WebRequestFacade.UploadFileEx("http://upload.issuu.com/1_0", media.GetReadStream(), media.GetOrgName(), "file", data));

            document.SetAttributeValue("publishing", "true");
            return(document);
        }
Example #2
0
        public static XElement GetDocument(IMediaFile media)
        {
            ServicePoint servicePoint = ServicePointManager.FindServicePoint(new Uri("http://api.issuu.com/1_0"));

            servicePoint.Expect100Continue = false;
            System.Net.ServicePointManager.Expect100Continue = false;
            var data = IssuuApi.NewQuery("issuu.documents.list");

            data.Add("orgDocName", media.GetOrgName());
            IssuuApi.Sign(data);

            var client = new System.Net.WebClient();

            byte[] responseArray = client.UploadValues("http://api.issuu.com/1_0", data);
            return(GetDocument(Encoding.ASCII.GetString(responseArray)));
        }