Custom app: how to get the ID required for an API call

Hello,

in my “Create new Subscriber” module (Listmonk) I want to specify the list(s) a new subscriber should be added.
During the scenario execution I only know the name of this list, but the API only accepts their IDs.

https://listmonk.app/docs/swagger/#/Subscribers/createSubscriber

In the mappable parameters I already have an RPC call which makes it conveniant for the user to specify the list:

    {
        "help": "The list of IDs of the lists to which the subscriber is being added. The `list_ids` attribute is required if the subscriber is being added to a list.",
        "mode": "edit",
        "name": "lists",
        "type": "select",
        "label": "Lists",
        "options": "rpc://getListIDs",
        "multiple": true
    },

I somehow need to “translate” the list names via a separate API call to transmit the numbers 2,4 instead of the two known list names. Example:

{
    "name": "Simon Templar",
    "email": "foo.meg+1753387195@company.com",
    "lists": [
        2, 4
    ],
    "status": "enabled"
}

How can I achieve this?
(I hope that I have given a clear description of my problem - don’t know how to express it in a better way…)

Thanks ,
Simon

Hi @smake ,

I think you’ll be able to do this by setting different “label” and “value” outputs on your current getListIDs RPC. The “value” will then be mapped to your Communication module, while the “label” is what the user will see.

The example given in the docs (Make.com - Custom App Documentation) looks like this:

{
	"url": "/status",
	"method": "GET",
	"response": {
		"iterate": "{{body.data}}",
		"output": {
			"label": "{{item.optionName}}",
			"value": "{{item.optionID}}"
		}
	}
}

Please let us know how you get on because this could help future users.

Regards, Terry.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.