Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CustomObject endpoint always points to data/customObject #14

Open
Yushell opened this issue Jul 14, 2016 · 3 comments
Open

CustomObject endpoint always points to data/customObject #14

Yushell opened this issue Jul 14, 2016 · 3 comments

Comments

@Yushell
Copy link

Yushell commented Jul 14, 2016

I have the following code for trying to create a CustomObject (Notice I added accountId)

List<FieldValue> coFieldValuesCreate = new List<FieldValue>()
{
    new FieldValue { id = 279, value = "[email protected]" }
};

CustomObject coCreate = new CustomObject();

if (customObjectType == CustomObjectType.Contact)
{
    coCreate.contactId = 775169;
}
else if (customObjectType == CustomObjectType.Account)
{
    coCreate.accountId = 3831189;
}

coCreate.fieldValues = coFieldValuesCreate;

CustomObject createResult = Credentials.client20.Data.CustomObject.Post(coCreate);
customObjectId = createResult.id;

I always get endpoint not found when trying to call
CustomObject createResult = myClient.Data.CustomObject.Post(myCustomObject);

I fear this is because Eloqua.Api.Rest.ClientLibrary.Models.Data.CustomObjects.CustomObjects.cs has its resource always poiting to:
[Resource("/data/customObject", "CustomObject")]

POST endpoint
/api/REST/2.0/data/customObject/{parentId}/instance

DELETE endpoint
/api/REST/2.0/data/customObject/{parentId}/instance/{id}

GET endpoint
/api/REST/2.0/data/customObject/{parentId}/instance/{id}

PUT endpoint
/api/REST/2.0/data/customObject/{parentId}/instance/{id}

How are these used?

I also tried calling
CustomObject getResult = Credentials.client20.Data.CustomObject.Get(125);

And still get endpoint not found

Note: Calls for contacts work perfectly.

Source: http://docs.oracle.com/cloud/latest/marketingcs_gs/OMCAC/api-Application-2.0-Custom%20object%20data.html

@kvantilburg
Copy link

Yushell,

I ran into this issue as well and have a fix for it. I think it's because the api has changed since the library was written. I'll try to get my changes into pull request this weekend.

@Yushell
Copy link
Author

Yushell commented Jul 14, 2016

Thank you kvantilburg. I really appreciate your help.

@kvantilburg
Copy link

I've created a pull request. I hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants