Question

Developer Platform: error in Code for POST Action

  • 18 May 2021
  • 1 reply
  • 164 views

Hello Support,

 

I am trying to post activity from zapier to accelo using below code, in zapier developer platform

const options = {
  url: 'https://happeningout.api.accelo.com/api/v0/activities/',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': `Bearer ${bundle.authData.access_token}`
  
  },
  
  _fields: {
    'against' : 'staff',
    'against_id' : '3',
    'body' : 'Hello World',
    'staff' : '3',
    'owner_id' : '3',
    'medium' : ‘note’


  }
 }

return z.request(options)
  .then((response) => {
    response.throwForStatus();
    const results = response.json;

    // You can do any parsing you need for results here before returning them

    return results;
  });


I am getting this error while trying to test this post activity

Error Msg

You need to choose a connected account or send something in the authData property.

 

Please help me to resolve this issue.

 

Thanks


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

1 reply

Userlevel 7
Badge +12

Hi @hapening 

have you configured your authentication and gotten successful authentication responses? You can also console log with the z object.

 

I.e z.console.log(bundle.authData) to try to learn more about the object.