Page 1 of 1

API to tag:new?

PostPosted: Sun Mar 22, 2020 11:16 am
by KIDS Country
How do you send mass TGs to newly registered players via the API? I get the call but it says I need stamps... doesn't this defeat the purpose of the API?

PostPosted: Sun Mar 22, 2020 12:37 pm
by The Ambassadors Reception
As I understand it, the API system for telegrams doesn't work that way. Each telegram needs to be sent to an individual.

I don't know what technology you are using. The way it would work though, it that you make an API call to get the list of the "new" nations.
https://www.nationstates.net/cgi-bin/api.cgi?q=newnations


That returns a list of the 50 newest nations, separated by commas.
You then telegram each nation individually.

If you're using an existing app, it may be able to do this for you. You'd have to check with the software author though.

Hope that helps

Edit:

This thread might help you get a good TG tool
viewtopic.php?f=15&t=350586

PostPosted: Sun Mar 22, 2020 12:42 pm
by Fauxia
There’s a handy guide for APIs. I suggest, if you don’t want to download something, you use Auralia’s nstg-web (it’s linked somewhere in the guide I sent). As I recall, you can actually address to send telegrams to new nations through nstg-web and it’ll come up with (and send telegrams to) a list for you.

If for some reason you’d rather make a call every 1/3 minutes manually, the post above me is correct. You need to make calls to individual nations.

PostPosted: Sun Mar 22, 2020 1:52 pm
by The Ambassadors Reception
Fauxia wrote:If for some reason you’d rather make a call every 1/3 minutes manually,

Not what I'm saying at all.
I'm saying that the telegrams need sent to individuals. You get the list of names, and every three minutes, send a telegram to the next name on the list. You can use a timer to automate that, which is how I imagine these other tools will work.

PostPosted: Wed Mar 25, 2020 5:29 am
by Sedgistan
The Ambassadors Reception wrote:
Fauxia wrote:If for some reason you’d rather make a call every 1/3 minutes manually,

Not what I'm saying at all.
I'm saying that the telegrams need sent to individuals. You get the list of names, and every three minutes, send a telegram to the next name on the list. You can use a timer to automate that, which is how I imagine these other tools will work.

That's not correct. As per the Script Rules, scripts can only legally send telegrams via the API. There are further details here: https://www.nationstates.net/pages/api.html#telegrams

I don't think you're sufficiently familiar with the Script Rules and how recruiting works to be giving out advice in this thread.

PostPosted: Wed Mar 25, 2020 8:29 pm
by The Ambassadors Reception
Sedgistan wrote:
The Ambassadors Reception wrote:Not what I'm saying at all.
I'm saying that the telegrams need sent to individuals. You get the list of names, and every three minutes, send a telegram to the next name on the list. You can use a timer to automate that, which is how I imagine these other tools will work.

That's not correct. As per the Script Rules, scripts can only legally send telegrams via the API. There are further details here: https://www.nationstates.net/pages/api.html#telegrams

I don't think you're sufficiently familiar with the Script Rules and how recruiting works to be giving out advice in this thread.

What's not correct?
Where am I suggesting that something other than the API is used?
The API limit for recruitment is one message per 180 seconds (=3 minutes).

From the source:
"Recruitment TGs: 1 telegram per 180 seconds"

"You must make one API call per recipient. If, for example, you want to send a message to 1,000 recipients, you need to compose the telegram, send it to tag:api, then make 1,000 API calls, spaced sufficiently far apart to abide by the ratelimit, to deliver all copies."

How would you code it, other than to get a list of new nation names via API, then use something to send a TG (3 minutes apart) to each individual?

PostPosted: Wed Apr 01, 2020 6:33 am
by The Ambassadors Reception
Bump. Curious as to where I'm wrong. I wouldn't want to inadvertently break site rules about recruitment telegrams.