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

Update CommonObjects.md #802

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 96 additions & 9 deletions guides/CommonObjects.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@

Select objects are reused, in full or partially, across multiple Wix APIs for easier implementation/consumption.

Even when an object is reused, the root level name and any relevant value names (e.g., filterable field names, enum names) may have been customized.

## Common query object

For example, an API that implemented the full common query object will look like this:

```
'{.
```json
'{
"query": {
"filter": {
"info.name.last": "Smith"};
"info.name.last": "Smith";
"sort": "[{\"dateCreated\"A: \"asc\"}]";
"fields": "email";
"fieldsets": "BASIC";
Expand All @@ -17,26 +21,109 @@ For example, an API that implemented the full common query object will look like
"offset": 30
};
"cursorPaging":
},
}'
},
},
}'
```

An API that implemented a partial common query object might look like this:

```
```json
'{
"query": {
"filter": {
"info.name.last": "Smith"};
"sort": "[{\"dateCreated\": \"asc\"}]";
"paging": {.
"paging": {
"limit": 30,
"offset": 30
},
}'
```
Even when an object is reused, the root level name and any relevant value names (e.g., filterable field names, enum names) may have been customized.

## Common address object

For example, an API that implemented the common address object will look like this:

```json
'{
"address": {
"country": "USA";
"subdivision": "LA";
"subdivisionIso31662": "LA";
"city": "Baton Rouge";
"postalCode": "70809";
"streetAddress": "7155 Exchequer Dr";
OR
"addressLine": "";
"addressLine2": "";
"formattedAddress": "";
"hint": "entrance is around the corner";
"geocode": "";
"countryFullname": "United States of America";
"subdivisionFullname": "Louisiana";
"subdivisions": "";

},
}'
```


## Common image object
An API that implemented the full common image object will look like this:

From January 2023, common objects will be documented as such.
```json
'{
"image": {
"id": "123456789";
"url": "";
"height": "";
"width": "";
"altText": "";
"urlExpirationDate": "";
"filename": "";
"sizeInBytes": "";
},
}'
```
An API that implemented a partial common image object might look like this:

```json
'{
"image": {
"id": "123456789";
"height": "";
"width": "";
},
}'
```

## Common video object

An API that implemented the full common image object will look like this:

```json
'{
"video": {
"id": "123456789";
"url": "";
"resolutions": "";
"filename": "";
"posters": "";
"urlExpirationDate": "";
"sizeInBytes": "";
"durationInMilliseconds": "";
},
}'
```

An API that implemented a partial common video object might look like this:

```json
'{
"video": {
"id": "123456789";
"resolutions": "";
},
}'
```