MPZ API > Upload Image(s)

Use the API to upload base 64 encoded images for use in newsletters.

Request

Submit an XML Request with the following details:
Post URL: https://mpzmail.com/api/v3.0/newsletters/addImages/
Fields to Post
apiKey String REQUIRED The APIKey of the requesting user.
files XML REQUIRED  
---> file XML REQUIRED  
------> fileExtension String REQUIRED The file extension. (PNG,GIF or JPG)
------> base64 String REQUIRED The base 64 encoded image.

Response

Data Sent Back
error Int Indicates wether an error has occured. 0 for no error. 1 for error.
status String If there's been an error, a text description of the error that occured will be here.
totFilesUploaded Int If successful, the number of files that were uploaded.
filesUploaded XML  
---> file XML  
------> shortName String The new file name of the file uploaded.
------> fullPath String The full URL to the new uploaded file.

Sample request XML

<xml>
     <apiKey>441233-121312131223</apiKey>
     <files>
          <file>
               <fileExtension>jpg</fileExtension>
               <base64>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA9IAAAIzCAYAAADs/CFNAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcw....</base64>
          </file>
     </files>
</xml>

Sample response XML

<xml>
     <error>0</error>
     <status>success</status>
     <totFilesUploaded>1</totFilesUploaded>
     <filesUploaded>
          <file>
               <shortName>12412414.jpg</shortName>
               <fullPath>http://mpzmail.com/users/1312124/12412414.jpg</fullPath>
          </file>
     </filesUploaded>
</xml>

Comments