Using Fiddler to import user records

Fiddler is a 3rd party application primarily for the use of HTTP dubbing. However, Fiddler can also be used to execute API calls which makes it useful for performing simple tasks against TeamDynamix APIs. You'll first need to download Fiddler from here. Follow the steps below to post a file to the user import API.

Once Fiddler is installed, go to the composer section of the tool. You first need to authenticate via the auth/loginadmin API to retrieve your Bearer token. Be sure to set the URL, header, and request body correctly:

Please note that installed customers need to use their URL in both POSTS. Ex. POST https://MYORG.teamdynamix.com/TDWebApi/api/auth/loginadmin

An example of the first post for SaaS/Cloud customers is as follows:

Type:
POST https://api.teamdynamix.com/TDWebApi/api/auth/loginadmin
Header:
User-Agent: Fiddler
Content-Type: application/json; charset=utf-8
Request Body:
{
BEID:"Insert BEID here",
WebServicesKey:"Insert WebServiceKey here"
}


The BEID and the Key can be retrieved from inside the admin console of your environment.

Also, similar to other standard APIs, the Bearer Token is unique to the request, so if you run the first POST twice, the first Token is then made invalid. Also, if you get a token,and do nothing with it for 3 days or more, it will expire. The tokens are also specific to URLs. If you say, run the first POST and successfully get a token back, and then change your URL for the second POST for some reason, the token will not be valid. Best practice is to grab a fresh token each time.

If your response is a 200, this should retrieve a Bearer Token, and the token is what is used to authenticate into TD to perform the second POST. To retrieve the bearer token, double click on the 200 response and the token should be in the body for that response. 

An example of the second post for SaaS/Cloud customers is as follows:

Type:
POST https://api.teamdynamix.com/TDWebApi/api/people/import
Header:
Authorization: Bearer <Paste token here but remove brackets for this line>
 

As far as the body content for the second POST, simply use the Upload file... link, select your file, and Execute. Fiddler will generate the rest. 

If successful, you can go into Admin-->Users-->import Jobs, and there you will see the status of the imports. Per the KB on the import, most will be staged to run during the non peak hours of the early morning the following day AND files over 4mb will probably throw a 500 error and the file will not be accepted.

Details

Article ID: 11194
Created
Mon 2/15/16 10:53 AM
Modified
Thu 7/11/19 11:31 AM