Using a Token
Once you have obtained a token you can use it to authenticate to a to a Spectrum OnDemand web service by including the token in the request. There are two ways of doing this: as an Authorization HTTP header or as a Cookie HTTP header.
Using the Token in an Authorization Header
To use the token in the HTTP Authorization header, use the format:
Authorization: Bearer Token
For example,
HTTP/1.1
POST http://MySpectrumServer:8080/soap/ValidateAddress
Host: MySpectrumServer:8080
Authorization: Bearer eyJlbmMiBMQI4Q0JDLUhTMjU2I5wiYWxnIjoiZGlyIn0..fc6rpRJ-wo
If the token is a session token, you must also provide the session identifier in the Cookie header in the form:
Cookie: SESSION=SessionID
For example,
HTTP/1.1
POST http://MySpectrumServer:8080/soap/ValidateAddress
Host: MySpectrumServer:8080
Authorization: Bearer eyJlbmMiBMQI4Q0JDLUhTMjU2I5wiYWxnIjoiZGlyIn0..fc6rpRJ-wo
Cookie: SESSION=fff96e54-1615-4192-96c1-ea2f133ec6eb
Authorization: Bearer Token
For example,
POST https://api.precisely.com/identify/identifymailing/v1/soap/validatemailingaddress
Authorization: Bearer eyJlbmMiBMQI4Q0JDLUhTMjU2I5wiYWxnIjoiZGlyIn0..fc6rpRJ-wo
Using the Token in a Cookie Header
If it is easier to use a cookie rather than the Authorization header you can provide the token in the Cookie header in the form:
Cookie: spectrum.authentication.token=Token
For example,
HTTP/1.1
POST http://MySpectrumServer:8080/soap/ValidateAddress
Host: MySpectrumServer:8080
Cookie: spectrum.authentication.token=eyJlbmMiBMQI4Q0JDLUhTMjU2I5wiYWxnIjoiZGlyIn0..fc6rpRJ-wo
If the token is a session token, you must also provide the session identifier in the Cookie header in the form:
Cookie: SESSION=SessionID
For example,
HTTP/1.1
POST http://MySpectrumServer:8080/soap/ValidateAddress
Host: MySpectrumServer:8080
Cookie: spectrum.authentication.token=eyJlbmMiBMQI4Q0JDLUhTMjU2I5wiYWxnIjoiZGlyIn0..fc6rpRJ-wo
Cookie: SESSION=fff96e54-1615-4192-96c1-ea2f133ec6eb