Page 1 of 1

API - how to set Profile Name

Posted: Sun Nov 24, 2019 4:48 pm
by enendza
How do I set the profile name to use for API calls?

Business has set up a new Profile area and the API can't get access to those files I get the error "You do not have access to open this order" However, when accessing the file through the SoftPro UI using the same credentials that the API uses I can load it just fine.

HELP ..

Thanks in advance

Emma

Re: API - how to set Profile Name

Posted: Mon Nov 25, 2019 10:50 am
by BobRichards
When the user account logs into Select manually, do you have to change/select profiles to get to the desired one? Or is the desired profile the default one? Please show your login code. I'm expecting to see where you subscribe to the "ChooseProfile" event.

Re: API - how to set Profile Name

Posted: Mon Nov 25, 2019 10:58 am
by enendza
Thanks for the reply.

My process is an unattended nightly process that runs using the SoftPro services so there isn't a UI where the user selects a profile, instead we have to programmatically connect to the profile - I know the name and the ID of the profile I just need to know the code to use to connect. Here is the code we have to connect to the SoftPro server


NetworkCredential auth = new NetworkCredential(AppSetting.SOFTPRO_USER_NAME, AppSetting.SOFTPRO_PASSWORD, AppSetting.AUTHDOMAIN);
_selectServer = new SelectServer(new Uri(AppSetting.SERVER), auth);

Re: API - how to set Profile Name

Posted: Mon Nov 25, 2019 11:31 am
by BobRichards
So it sounds like the automated process is logging into the wrong profile.
  • If the user account has only one profile associated with it, it will be used as the active profile.
  • If there is more than one profile associated with the account and none of them has previously been selected as the "default" profile, the user must pick one at login. The SelectServer.ChooseProfile event allows the API to select the default profile. You should subscribe to it and select one of the profiles that is passed in the event args list.
  • If there is more than one profile associated with the account and a default profile has is already selected, it will be used as the active profile.

Re: API - how to set Profile Name

Posted: Wed Nov 27, 2019 2:55 pm
by enendza
ok thanks