Ariel S Posted February 15, 2022 Posted February 15, 2022 Hi, When I access to the RSS through the website, I see there is a parameter "key" with a guid. That guid is updated each some days. I'm trying to do a webrequest from my code to get the RSS XML without passing that "key" parameter. I'm getting a Forbidden (403) error. I'm setting the admin credentials in the code. This is my source code: HttpWebRequest request = (HttpWebRequest)WebRequest.Create("https://social.vcoins.com/rss/4-this-week-in-history-vcoins-community.xml"); request.UserAgent = "My User Agent"; request.Credentials = new NetworkCredential("xxxxxxxxxxx", "xxxxxxxxxxxxxx"); document.Load(request.GetResponse().GetResponseStream()); I would approciate your help! Thanks! Ariel
Marc Posted February 15, 2022 Posted February 15, 2022 We are unable to assist with custom development unfortunately. I would ask however, why it is you need to pass credentials at all? That feed appears to be public anyway. Also, why would you not use the key?
Ariel S Posted February 15, 2022 Author Posted February 15, 2022 I add that the "Groups that can see this feed" field is set only for Administrators. I understand that setting the admin credentials, it should work! However, I continue getting the 403 error.
Marc Posted February 15, 2022 Posted February 15, 2022 You would use the key, not try to set networkcredentials as you are trying to do there. You may actually be best to use the REST API to get your data however, if its just the topics you are trying to get
Ariel S Posted February 15, 2022 Author Posted February 15, 2022 Thanks Marc for your answer. I just changed the feed to public. I don't want it public. The key is not the same always. I see it was updated this week automatically. I don't know if I'm doing something in the incorrect way. Ariel How can I get the key via API? Is it correct that it is updated every week?
Marc Posted February 15, 2022 Posted February 15, 2022 If you access using a key of a person logged in, that key would remain. You would pass the member_id and key field With regard the REST API, Im not referring to getting the key. Im referring to getting the data.
Ariel S Posted February 15, 2022 Author Posted February 15, 2022 I'm thinking that maybe the key was changed because the admin password was changed. Is it make sense? Also, where can I get the admin key in the ACP? I'm in the admin member page. Ariel
Marc Posted February 15, 2022 Posted February 15, 2022 RSS does not have basic auth, so you cant use what you are trying to use there. You cannot access the key via the admin CP, you would key it from selecting the feed. If credentials change, then yes the key would change. So if you changed your password it would indeed change. What exactly is it you are trying to do here? You can get to most information from the REST API, and would then use a key for this purpose
Ariel S Posted February 15, 2022 Author Posted February 15, 2022 I know I could get the key from the URL when I open the RSS. However, I want to be sure that key doesn't change. Could you confirm me that the key does NOT changes except the member password is changed? Excellent Marc. Thank you!
Marc Posted February 15, 2022 Posted February 15, 2022 The key changes if anything related to authentication changes. So password, displayname, emails. Again however, if you let us know what it is you are trying to achieve, we may be able to point you in a better direction. Getting data this way would be unusual
Ariel S Posted February 15, 2022 Author Posted February 15, 2022 What I was trying to do is to get the feed XML (https://social.vcoins.com/rss/4-this-week-in-history-vcoins-community.xml/?member_id=1&key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) through my source code. I was passing the incorrect key because I changed the member password some days ago. Now, I know that if I don't change anything from the admin member, the key should not be changed and I should not have problems to get the feed XML Ariel
Marc Posted February 15, 2022 Posted February 15, 2022 I think you may have misunderstood the question there. I mean what is it you need it in RSS format for? As mentioned. You would not usually get the data in this way
Ariel S Posted February 15, 2022 Author Posted February 15, 2022 I need the last 3 articles of each section to show them in another website. I run a process weekly that get some data from the feed and save it in a database. Then, the other website gets the data from the database to show it.
Solution Marc Posted February 15, 2022 Solution Posted February 15, 2022 Yes, you would be going the wrong way about this. You really should use the REST API which is built for this purpose. You can see the details for the API here https://invisioncommunity.com/developers/rest-api
Ariel S Posted February 15, 2022 Author Posted February 15, 2022 Excellent. I will make the change when I have some time! In the meantime, with the current way, could I get the data?
Marc Posted February 15, 2022 Posted February 15, 2022 6 minutes ago, Ariel S said: Excellent. I will make the change when I have some time! In the meantime, with the current way, could I get the data? If you use the key and member_id you could
Recommended Posts