importrequeststoken='Your token'url_base='https://app.teenvio.com/v4/public/api/rest/v3'my_headers={'Accept':'application/json','X-Token':token,'Content-Type':'application/json'}post_request={"rid":1,"pid":1,"contact_id":1,"name":"test vars","subject":"This is a test","vars":{"discount":20,"expire":"Enero"}}response=requests.post(url_base+"/campaign/",json=post_request,headers=my_headers)print(response.json())
constaxios=require('axios');consttoken='Your token';consturl_base='https://app.teenvio.com/v4/public/api/rest/v3';constmy_headers={'Accept':'application/json','X-Token':token};constpost_request="rid":1,"pid":1,"contact_id":1,"name":"test vars","subject":"This is a test","vars":{"discount":20,"expire":"Enero"}};axios.post(url_base+'/campaign/',post_request,{headers:my_headers}).then(resp=>{console.log(resp.data);});