[SalesForce] REST API: How to insert values for picklist and lookup field types

Introduction

Hello, I'm working on synchronising data from a MySQL database into Salesforce using the REST API. I've got as far as inserting basic text values, but for complex field types such as picklist and lookup, I'm unable to find any documentation on the correct format. I've tried to send in objects and arrays, as well as having spent quite a few hours looking for solutions. I keep getting errors like:

{"message":"Cannot deserialize instance of multipicklist from START_ARRAY value [line:1, column:51]","errorCode":"JSON_PARSER_ERROR"}

From JSON payloads like:

{"FirstName":"Doug","LastName":"Proctor (testing)","s360__Contact_Code__c":["Individual supporter - donor"]}

Where s360__Contact_Code__c is a picklist field. I'm also having problems with lookups, where I need to refer to another object of the same type as a referrer.

As I said, I have no problems with actually getting basic objects into the database when I only populate text fields.

Question

Where would I find the correct formats when POSTing/PATCHing fields of these types?

Sorry if I'm not being clear, I'm a real Salesforce novice and the amount of information and capabilities the product has is quite overwhelming.

Best Answer

Picklist values are strings. Multi Select Picklist values are semicolon-separated strings. Lookups are 18 character strings where the 18 character string is the ID of the record being looked up to.

This documentation should help.