API - how to set Profile Name

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
enendza
Posts: 68
Joined: Wed Oct 16, 2019 12:22 pm

API - how to set Profile Name

Post by enendza » Sun Nov 24, 2019 4:48 pm

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

BobRichards
Posts: 1007
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: API - how to set Profile Name

Post by BobRichards » Mon Nov 25, 2019 10:50 am

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.
Bob Richards, Software Developer, SoftPro

enendza
Posts: 68
Joined: Wed Oct 16, 2019 12:22 pm

Re: API - how to set Profile Name

Post by enendza » Mon Nov 25, 2019 10:58 am

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);

BobRichards
Posts: 1007
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: API - how to set Profile Name

Post by BobRichards » Mon Nov 25, 2019 11:31 am

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.
Bob Richards, Software Developer, SoftPro

enendza
Posts: 68
Joined: Wed Oct 16, 2019 12:22 pm

Re: API - how to set Profile Name

Post by enendza » Wed Nov 27, 2019 2:55 pm

ok thanks

Post Reply