This API request stores or updates opportunity data for a specific site using the HTTP method PUT. The request includes the following parameters:
Authorization
stringRequired The authorization token for accessing the API. The header value should be set to "Bearer {your-access-token}", where {your-access-token}
is the access token assigned to the user.
The data containing the opportunity information to store/update. The payload should include the following parameters:
OpportunityValue
intRequiredThe value of the opportunity
OpportunityDateTime
stringRequiredThe date and time the opportunity was captured. Must be in ISO 8601 format. yyyy-MM-dd
PipelineStage
stringRequiredThe stage of the pipeline for the opportunity
VisitorIdentifierOptions
ArrayRequiredAn array of visitor identifiers. Each item in the array should include the following parameters:
Key
stringRequiredThe key for the visitor identifier. Accepted Keys: EmailAddress, PhoneNumber, RaId, PayloadValue, CookieValue
Value
stringRequiredThe value for the visitor identifier.
CurrencyCode
stringRequiredThe appropriate currency code used for the Opportunity Value. This should be in ISO 4217 format. E.g. GBP
Labels
Array(string)Opportunity Labels
The {your-access-token}
parameter in the authorization header should be replaced with the appropriate access token.
curl -X PUT \ 'https://rest.rulerapi.com/v1/{siteId}/opportunity/upload' \ -H 'Authorization: Bearer {your-access-token}' \ -H 'Content-Type: application/json' \ -d '{ "OpportunityValue": "{value}", "OpportunityDateTime": "{datetime}", "PipelineStage": "{pipelinestage}", "VisitorIdentifierOptions": [ { "Key": "{key}", "Value": "{value}" } ], "CurrencyCode": "{currencycode}", "Labels": [ "{labels[0]}", "{labels[1]}" ] }'