Create Tag API Help

Hello,

Im trying to create a tag and keep getting back this error ({"message":"Input could not be converted to a valid request"})

Here is my code below, when I test it on post man it creates it successfully but get an error when I hit the endpoint on my app. Thank you!

request.post(`https://api.infusionsoft.com/crm/rest/v1/tags?access_token=${accessToken}`, {
        "category": {
          "id": "",
          "name": ""
        },
        "description": "Test",
        "name": "TEST 42"
      }, function(error, response, body) {
        // console.log(`THISISTHEBODY:`, JSON.parse(body));
        if (error) {
          // res.status(500).send(error);
          console.log(`Error: `, error)
        } else {
          // res.send('TAG CREATED');
        }
      });

Solved! it worked by sending it in like this:

  request.post({
    url:     `https://api.infusionsoft.com/crm/rest/v1/tags?access_token=${accessToken}`,
    json:    {
      category: {
        id: "",
        name: ""
      },
      description: "TEST",
      name: "TEST 42"
    }
  }
1 Like