listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

PUT /api/subscribers/:id doesn't work!

Open mahmoudmy opened this issue 5 years ago • 2 comments

I tried to update a subscriber info by calling PUT /api/subscribers/23 with such a request body:

{ "status": "enabled" }

The request returns 200, but the returned object doesn't change!

mahmoudmy avatar Dec 08 '20 21:12 mahmoudmy

@mahmoudmy I presume you got this to work since the issue is closed? I am facing the same problem, no matter what data passed to the PUT endpoint no update is working. How did you manage to use it?

BenBao93 avatar Mar 09 '21 11:03 BenBao93

curl 'http://localhost:9000/api/subscribers/2' -X \
	PUT  'Content-Type: application/json;charset=utf-8'
	--data-raw '{"email":"[email protected]","name":"Anon Doe 123","status":"enabled"}'

Updates and returns:

{
	"data": {
		"id": 2,
		"created_at": "2021-03-09T12:14:22.150395Z",
		"updated_at": "2021-03-09T12:14:42.552177Z",
		"uuid": "eb4efe02-4e57-4565-be1e-60616b7e93fe",
		"email": "[email protected]",
		"name": "Anon Doe 123",
		"attribs": {},
		"status": "enabled",
		"lists": [
			{
				"subscription_status": "unconfirmed",
				"id": 2,
				"uuid": "5a42c6a4-6367-446a-b1ac-fb1918e29168",
				"name": "Opt-in list",
				"type": "public",
				"optin": "double",
				"tags": [
					"test"
				],
				"created_at": "2021-03-09T12:14:22.145619+00:00",
				"updated_at": "2021-03-09T12:14:22.145619+00:00"
			}
		]
	}
}

You can inspect the update request going from the UI. It's the same API.

knadh avatar Mar 09 '21 12:03 knadh