Home Forums Newsletter Plugin Support API subscription Lists Object does not work

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #286017
    Yo-Fly
    Participant

    Hi,
    I set up a custom Subscription Form being sent to “/wp-json/newsletter/v2/subscriptions” a while ago and eventually got everyhting to work.
    RIght now I am experiencing one issue with my listsobject as it is being ignored when creating the new subscriber.
    I am using this syntax (as the example in the Swagger UI):

    
    {
        "email": "foo@bar.de",
      "lists": [
    {
          "id": 4,
          "value": 1
        },
    {
          "id": 5,
          "value": 1
        }
    ],
      "last_name": "Foo"
    }
    

    The lists are public and yet not being set.

    However, if I use the alternative with just an array of to be set lists, it seems to work:

    
    {
        "email": "foo@bar.de",
      "lists": [4,5],
      "last_name": "Fleischhut"
    }
    

    I would prefer the first way, though, as some of the lists are set dynamically, so sometimes I will put a 0 and sometimes a 1.
    Am I doing anything wrong or missing anything? Thanks in advance!

    #286021
    Stefano
    Keymaster

    Hi, which version of the Newsletter API are you using? Could you kindly check the addon version? There was a bug on the previous version.
    The second format (array) can be used with a negative number to unset a list (yes, it is not correctly documented).

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.