Save agency - DEPRECATED

Creates or modifies an agency.

Request

POST /agency/save

Request Contents

Name Type Description Required
idNumberAgency IDRequired for update.
nameStringAgency nameYes
contact_nameStringContact nameYes
streetStringStreet addressYes
cityStringCityYes
stateStringStateYes
zipStringZip/Postal CodeYes
countryStringCountryYes
phoneStringPhoneYes
faxStringFaxYes
emailStringEmailYes
descriptionStringDescriptionYes
externalAgencyIdStringExternal ID for the AgencyNo

Response Contents

Name Type Description
messagesObject ArrayAn array of any error messages.
messages[].levelStringError level.
messages[].codeStringError code.
messages[].messageStringError message.
entityObjectAn agency object.
entity.idNumberAgency ID.
entity.nameStringAgency name.
entity.contact_nameStringContact name
entity.streetStringStreet address
entity.cityStringCity
entity.stateStringState
entity.zipStringZip/Postal code
entity.countryStringCountry
entity.phoneStringPhone
entity.faxStringFax
entity.emailStringE-mail
entity.descriptionStringDescription
entity.externalAgencyIdStringExternal ID for the Agency

Examples

Request to create an agency

Since the ID field is omitted, this example creates a new agency.

curl -u \<user>:\<password> -X POST -H "Content-Type: application/json" -d '\{   "name" : "My new agency", "contact\_name": "John Smith", "street": "123 Any St", "city": "New York", "state": "NY", "zip": "10018", "country": "USA", "phone": "555-555-5555", "fax": "444-444-4444", "email": "[email protected]", "description": "This is my new agency", "externalAgencyId": "abc#1234"}' https://sandbox-api.viant.com/v1/agency/save

JSON Response

{
  "messages": [],
  "entity": {
    "id": 3318,
    "name": "My new agency",
    "contact_name": "John Smith",
    "street": "123 Any St",
    "city": "New York",
    "state": "NY",
    "zip": "10018",
    "country": "USA",
    "phone": "555-555-5555",
    "fax": "444-444-4444",
    "email": "[email protected]",
    "description": "This is my new agency",
    "externalAgencyId": "abc#1234"
  }
}

Request to edit an agency

This example uses the agency ID to change the name of the agency.

curl -u \<user>:\<password> -X POST -H "Content-Type: application/json" -d '\{"id": 3318, "name" : "My best agency", "contact\_name": "John Smith", "street": "123 Any St", "city": "New York", "state": "NY", "zip": "10018", "country": "USA", "phone": "555-555-5555", "fax": "444-444-4444", "email": "[email protected]", "description": "This is my best agency", "externalAgencyId": "abc$1234"}' https://sandbox-api.viant.com/v1/agency/save

Response

{
  "messages": [],
  "entity": {
    "id": 3318,
    "name": "My best agency",
    "contact_name": "John Smith",
    "street": "123 Any St",
    "city": "New York",
    "state": "NY",
    "zip": "10018",
    "country": "USA",
    "phone": "555-555-5555",
    "fax": "444-444-4444",
    "email": "[email protected]",
    "description": "This is my best agency",
    "externalAgencyId": "abc$1234"
  }
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!