Last active
May 24, 2017 19:02
-
-
Save rachelpw/ad7dc942d811423916037275b3569f7f to your computer and use it in GitHub Desktop.
Sample CURL request to make an opportunity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --request POST \ | |
--header "Content-Type: application/json" \ | |
--header "X-PW-AccessToken:TOKEN" \ | |
--header "X-PW-Application:developer_api" \ | |
--header "X-PW-UserEmail:EMAIL" \ | |
https://api.prosperworks.com/developer_api/v1/opportunities \ | |
--data '{ | |
"name":"Test Opportunity", | |
"primary_contact_id":16885672, | |
"assignee_id":122867, | |
"customer_source_id":169846, | |
"monetary_value": 6974, | |
"company_id":13220798, | |
"close_date":"12/25/2017", | |
"details":"These are details", | |
"tags":["Testtag"], | |
"custom_fields":[ | |
{ | |
"custom_field_definition_id":26344, | |
"value":"testentry" | |
} | |
], | |
"pipeline_id":103307, | |
"pipeline_stage_id":498010 | |
}' | |
To do this, you will have to get all IDs for: | |
1. Assignee IDs | |
curl -H "Content-Type: application/json" -X GET | |
--header "X-PW-AccessToken:<TOKEN>" | |
--header "X-PW-Application:developer_api" | |
--header "X-PW-UserEmail:<USER_EMAIL_ADDRESS>" | |
https://api.prosperworks.com/developer_api/v1/users | |
2. Customer sources | |
curl -H "Content-Type: application/json" -X GET \ | |
--header "X-PW-AccessToken:<TOKEN>" \ | |
--header "X-PW-Application:developer_api" \ | |
--header "X-PW-UserEmail:<USER_EMAIL_ADDRESS>" \ | |
https://api.prosperworks.com/developer_api/v1/customer_sources | |
3. Custom fields | |
curl -H "Content-Type: application/json" -X GET \ | |
--header "X-PW-AccessToken:<TOKEN>" \ | |
--header "X-PW-Application:developer_api" \ | |
--header "X-PW-UserEmail:<USER_EMAIL_ADDRESS>" \ | |
https://api.prosperworks.com/developer_api/v1/custom_field_definitions | |
4. Pipeline IDs and stages | |
curl --request GET \ | |
--header "Content-Type: application/json" \ | |
--header "X-PW-AccessToken:<TOKEN>" \ | |
--header "X-PW-Application:developer_api" \ | |
--header "X-PW-UserEmail:<USER_EMAIL_ADDRESS>" \ | |
https://api.prosperworks.com/developer_api/v1/pipelines | |
5. You will also have to validate that the Primary contact ID and Company ID still exist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment