# Infocon
Infocon (opens new window) is the third party vendor that Momentum uses to translate the VAN EDI from Sherwin Williams into JSON API endpoints.
# Endpoints
The following endpoints are provided by Infocon:
# Token
https://www.InfoconAPICLoud.com/token
Method: POST
This is used to receive an access token and refresh token based on the given login credentials. The username and password can be found in SYSMON SW.EDI.TOKENS in fields 3 and 4.
The access token is a short lived token that is sent along with other API requests.
The refresh token is used to get a new access token when the access token expires. The refresh token is long-lived and shouldn't expire except after a year or two.
WARNING
This endpoint should really only be used once every couple of years when the refresh token has expired. Use the refresh token endpoint to get a new access token in most cases.
# Refresh Token
https://www.InfoconAPICLoud.com/refreshtoken
Method: POST
This endpoint will use the refresh token to give a new access token that can be used with the other endpoints. Think of the refresh token as an API secret key.
The Access Token and the Refresh Token can be found in SYSMON SW.EDI.TOKENS fields 1 and 2, respectively.
# Get outbound with date
https://www.InfoconAPICLoud.com/mt/outbound/getoutbounddatawithdate/2305/850/2020-01-01/2020-12-09
Method: GET
This endpoint will give all purchase orders from a specific date range.
This is the endpoint that is used in the system to get the purchase orders.
# Get outbound without date
https://www.InfoconAPICLoud.com/mt/outbound/getoutbounddatawithoutdate/2305/850
Method: GET
This endpoint will give all purchase orders.
Note
This endpoint is not being used because I wanted to limit the amount of orders we had to process every 15 minutes. However, after the program was built, I found out that Infocon was planning on removing purchase orders as they were received by Momentum so this could have been a viable option after all.
# Post 855
https://www.InfoconAPICLoud.com/mt/post855/2305/
Method: POST
This endpoint accepts a JSON acknowledgment to be sent back to Sherwin Williams.
# Post 810
https://www.InfoconAPICLoud.com/mt/post810/2305
Method: POST
This endpoint accepts a JOSN invoice to be sent back to Sherwin Williams.
# Headers
It is necessary to send the following header:
Ocp-Apim-Subscription-Key: 65ec...
The exact key is stored in SYSMON SW.EDI.TOKENS field 12.
# Portal
Infocon provides a portal (opens new window) that we can access to see what has been sent and received.
The credentials for this site are stored in SYSMON SW.EDI.TOKENS fields 13 and 14.
# Password Reset
Every so often (6 months?), the Infoconn API password will expire and you will manually need to change the password through a provided link. When checking for new orders, it should send back an expired password with a link in the JSON. This should be then sent to the SW admin email address(es).
- Click on the link (opens new window). (It might help to copy the link and paste it into an incognito browser so you won't get logged into an already authenticated Microsoft session)
- Enter the username found in
SYSMON SW.EDI.TOKENSfield 3. (Yes, they misspelled momemtum) - Enter the current password found in field 4 and the new password.
- It might ask if you want to stay signed in. Answer either way.
- The confusing part is it takes you to another reset password page. You can ignore this as the password should already be changed. Close the browser.
- Now update the password in
SYSMON SW.EDI.TOKENSfield 4 in the production system.