Hi, Im building an chat-bot app, and I use your Trello API, to create organizations and boards, I want to invite people to these boards sending them invite links, but I couldnt find a way to generate one.
I only found API docs about inviting people with email, but it isnt really what I need
If we explore request, that is sent from Trello web-site, we can see that there are 2 things in request’s payload
“token” - as I supose it is user_id/session_id, if we make requests from outside this is only an API token
“type”: “normal:” -I didn’t really understand what it is.
So if Im using a REST API to send this request I configure my payload as
Also found this topic, but as I suppose Adriana is missing the fact that server is blocking request to this url (or am I 'm being stupid and missing something obvious )
i don’t see a request payload like that in my network when i open the share modal. the web client should make a request to https://trello.com/1/boards/:idBoard/invitationSecret, as you’ve identified. however, there is no key and token in the parameters of that request.
i believe that you need the cookie from your browser to generate the invitation secret, and it’s set in the request headers, not as a parameter. that request should return a payload like {secret: '', type: 'normal}. that secret is referenced in the previous post, and can be sent to https://trello.com/invite/b/:idBoard/:secret to redirect to the ‘shared board’ page.
so, in sum:
if you have access to your cookie, you make a request to https://trello.com/1/boards/:idBoard/invitationSecret to generate a secret, using the cookie in the headers and not as a request parameter/body
use the returned secret to send a generated invite link like https://trello.com/invite/b/:idBoard/:secret, which will redirect to the “[user] has shared this board” page
Thats kinda worked for GET request, I just copy-pasted all ‘cookie’ header from direct request to …/invitationSecret from browser and GET request to API returned a secret, but it still doesnt works with POST, witch as I see in browser, creates secrets
When i click Create link it sends POST request to invitationSecret, to create one and then GET to actually… get it and push it into copy link thing
so if I want to send invites automatically, I need to do both POST & GET
UPD
Actually It is doable with only POST as it returns the same Json as GET, so I just need to make 1 POST request and get secret from it’s response