NATION

PASSWORD

API to tag:new?

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
KIDS Country
Attaché
 
Posts: 99
Founded: Aug 10, 2017
Ex-Nation

API to tag:new?

Postby KIDS Country » Sun Mar 22, 2020 11:16 am

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?

User avatar
The Ambassadors Reception
Bureaucrat
 
Posts: 63
Founded: Sep 16, 2018
Ex-Nation

Postby The Ambassadors Reception » Sun Mar 22, 2020 12:37 pm

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
Last edited by The Ambassadors Reception on Sun Mar 22, 2020 12:40 pm, edited 1 time in total.

User avatar
Fauxia
Senator
 
Posts: 4827
Founded: Dec 22, 2016
Left-Leaning College State

Postby Fauxia » Sun Mar 22, 2020 12:42 pm

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.
Reploid Productions wrote:Unfortunately, Max still won't buy the mods elite ninja assassin squads to use, so... no such luck.
Sandaoguo wrote:GP is a den of cynics and nihilists
My opinions do not represent any NS governments I may happen to be in (yeah right), any RL governments I may happen to be in (yeah right), the CIA, the NSA, the FBI. the Freemasons, the Illuminati, Opus Dei, the Knights Templar, the Organization for the Advancement of Cultural Marxism, Opus Dei, or any other organization. Unless I say they do, in which case, there is a nonzero chance.

User avatar
The Ambassadors Reception
Bureaucrat
 
Posts: 63
Founded: Sep 16, 2018
Ex-Nation

Postby The Ambassadors Reception » Sun Mar 22, 2020 1:52 pm

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.

User avatar
Sedgistan
Site Director
 
Posts: 35471
Founded: Oct 20, 2006
Anarchy

Postby Sedgistan » Wed Mar 25, 2020 5:29 am

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.

User avatar
The Ambassadors Reception
Bureaucrat
 
Posts: 63
Founded: Sep 16, 2018
Ex-Nation

Postby The Ambassadors Reception » Wed Mar 25, 2020 8:29 pm

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?
Last edited by The Ambassadors Reception on Wed Apr 01, 2020 10:56 am, edited 3 times in total.

User avatar
The Ambassadors Reception
Bureaucrat
 
Posts: 63
Founded: Sep 16, 2018
Ex-Nation

Postby The Ambassadors Reception » Wed Apr 01, 2020 6:33 am

Bump. Curious as to where I'm wrong. I wouldn't want to inadvertently break site rules about recruitment telegrams.


Advertisement

Remove ads

Return to Technical

Who is online

Users browsing this forum: Arzareth, Canvalland, Demailvathevorld, Futurist State of Agladnare, Inferior, Lunayria, Novo Wagondia, Omakise, Patriums, Pierpontia, Podlachian State, Shirahime

Advertisement

Remove ads