Guest User

Untitled

a guest
Mar 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. let options = {
  2. uri: '/asset/v1/content/assets',
  3. json: true,
  4. body: MCData
  5. }
  6.  
  7. const RestClient = new FuelRest({auth: FuelAuthClient});
  8. RestClient.post(options)
  9. .then((result) => {
  10. console.dir(result);
  11. })
  12. .catch((error) => {
  13. console.dir(error);
  14. })
  15.  
  16. {
  17. "name":"Document 123",
  18. "assetType":{
  19. "name":"png",
  20. "id":28
  21. },
  22. "file":"data:image/png;base64, REST OF THE Encoded IMAGE HERE"
  23. }
  24.  
  25. { message: 'Internal Server Error',
  26. errorcode: 0,
  27. documentation: 'https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm' }
Add Comment
Please, Sign In to add comment